【发布时间】:2010-07-16 09:19:20
【问题描述】:
我有 2 个问题要问你。
我正在创建一个依赖于 Jabber 的聊天应用程序,我的服务器是服务器端的端口 5222。
端口 Ping
如何通过端口 5222 ping 服务器并检查其是否打开和响应。
类似Ping.Once(Settings.Defualt.ChatServerDomain,Settings.Defualt.ChatServerPort);
代理认证
在我的工作中,由于我们运行的代理服务器,我的应用程序无法登录,在 IE 中,您可以设置代理设置以允许所有常规应用程序连接,但我的应用程序不使用这些设置。
所以我需要做的是创建一个小检查器来查看是否在代理服务器后面,以及我们是否显示一个窗口来验证用户凭据。并将应用程序绑定到它们的凭据,以便在应用程序打开期间对任何请求进行身份验证。
这就是我在编码术语中的意思
if(ProxyAuthRequired())
{
ProxyAuthWindow ProxyAuthWindow = new ProxyAuthWindow();
CurrentWindow.Enable = false;
/*
* Within the Form ProxyAuthWindow, This will callback to my main controller after
* The auth is checked and ok, This is what i do not know how to do
*/
ProxyAuthWindow.Show(); //Ask for the credentials and check the port inside here
}
【问题讨论】:
-
请把这个问题分成两个问题。
-
确实有同样的问题,连接到服务器,并对服务器进行身份验证。我不介意把它们分开
标签: c# proxy port ping authentication