项目目标:
使用控制台或Windows窗体应用程序创建本地代理判断程序,以调试和测试连接.
>项目必须请求并接收代理ServerVariables以在客户端显示.
>解析IPAddress并返回匿名状态.
>实施基本的教学方案.
>项目不得使用脚本来实现功能(例如)PHP,Perl,Asp等.
>多平台兼容(可能)
问题:
>是否可以在本地Windows或控制台应用程序上使用Request.ServerVariables,还是特定于ASP?
>如果此方法是ASP特定的,还有另一种方法从浏览器会话请求ServerVariables吗?
>如果上述方法可行,那么实现此功能的正确方法是什么?
>这里验证/设置基本认证方案的好例子是什么?喜欢设置密码和使用的用户等.
示例代码:
using System.IO;
using System.Net;
using System.Web;
using System.Collections.Specialized;
namespace IPJudge
{
public class IPJudgeClass : IHttpModule
{
public static void Main()
{
using (HttpListener listener = new HttpListener())
{
listener.AuthenticationSchemes = AuthenticationSch