且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何通过用户名和密码保护C#webservice?

更新时间:2021-09-02 21:41:08

如果它是WCF我相信你可以通过web.config做到这一点,而无需更改任何代码。否则,编写一些代码来进行身份验证。或者,在IIS中托管它并在那里设置身份验证。你有几个选择。
If it is WCF I believe you can do that through the web.config without any code changes. Otherwise, write some code to do the authentication. Or, host it in IIS and set the authentication there. You have several options.