private static void PingProxy() { PingService.PingService pingService = new PingService.PingService(); pingService.Url = FI.Common.AppConfig.ReadSetting("PingServiceURL", ""); pingService.Timeout = int.Parse(FI.Common.AppConfig.ReadSetting("PingServiceTimeout", "600000")); string user = FI.Common.AppConfig.ReadSetting("PingServiceUser", ""); string password = FI.Common.AppConfig.ReadSetting("PingServicePassword", ""); string pingProxy = FI.Common.AppConfig.ReadSetting("PingServiceProxy", ""); string pingMdx = FI.Common.AppConfig.ReadSetting("PingMdx", ""); string pingMailTo = FI.Common.AppConfig.ReadSetting("PingMailTo", ""); if (pingProxy != "") { pingService.Proxy = new System.Net.WebProxy(pingProxy); } if (user != "") { pingService.Credentials = new System.Net.NetworkCredential(user, password); } else { pingService.Credentials = System.Net.CredentialCache.DefaultCredentials; } pingService.PingOlapSystem(pingMdx, pingMailTo); }
private static void PingProxy() { PingService.PingService pingService=new PingService.PingService(); pingService.Url = FI.Common.AppConfig.ReadSetting("PingServiceURL", ""); pingService.Timeout = int.Parse(FI.Common.AppConfig.ReadSetting("PingServiceTimeout", "600000")); string user = FI.Common.AppConfig.ReadSetting("PingServiceUser", ""); string password = FI.Common.AppConfig.ReadSetting("PingServicePassword", ""); string pingProxy = FI.Common.AppConfig.ReadSetting("PingServiceProxy", ""); string pingMdx = FI.Common.AppConfig.ReadSetting("PingMdx", ""); string pingMailTo = FI.Common.AppConfig.ReadSetting("PingMailTo", ""); if(pingProxy!="") { pingService.Proxy=new System.Net.WebProxy(pingProxy); } if(user!="") pingService.Credentials=new System.Net.NetworkCredential(user, password); else pingService.Credentials=System.Net.CredentialCache.DefaultCredentials; pingService.PingOlapSystem(pingMdx , pingMailTo); }