C#Ping特定端口和代理凭据

时间:2010-07-16 09:19:20

标签: c# proxy port ping authentication

我有2个问题要问你。

我正在创建一个依赖于Jabber的聊天应用程序,女巫是我的服务器端口5222用于服务器方面。

Port 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
}

1 个答案:

答案 0 :(得分:3)

  1. 对于Ping:尝试Ping class

  2. 以下是check and set the proxy凭据的方式。

相关问题