开发者

C# Pinging particular ports and proxy credentials

I have 2 questions for you.

Im creating an Application for Chat that relies on Jabber, witch is my server is port 5222 for t开发者_开发技巧he server side of things.

Port Ping

How can I ping a server via Port 5222 and check to see if its open and responding.

Something like Ping.Once(Settings.Defualt.ChatServerDomain,Settings.Defualt.ChatServerPort);

Proxy Authentication

At my work my applications does not login because of the proxy server we run, In IE you can set the proxy settings witch allow all the general applications to connection threw, but my application does not utilize these settings.

so what I need to do is create a small checker to see if were behind a proxy server and if we am show a window to authenticate the user credentials. and also bind the application to them credentials so any request will be authenticated during the application being open.

This is what I mean in Coding Terms

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. For Ping: Try Ping class

  2. Here is how you can check and set the proxy credentials.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜