如何抛出未认证(Unauthorized=401)异常代码

 throw new System.ServiceModel.Web.WebFaultException<string>(""mes":"认证信息失效"", System.Net.HttpStatusCode.Unauthorized);

需要引用 System.ServiceModel.Web.dll

原文地址:https://www.cnblogs.com/ligl/p/5006585.html