Ejemplo n.º 1
0
        protected static string GetUrlFromIni()
        {
            string path = System.Windows.Forms.Application.StartupPath + "\\Config.ini";
            string url  = IniUtil.ReadIniValue(path, "CallNumberService", "Url");
            string port = IniUtil.ReadIniValue(path, "CallNumberService", "Port");

            return(string.Format("http://{0}:{1}/TCHIS/CallNumberService/CallNumberWebService.asmx", url, port));
        }
Ejemplo n.º 2
0
        protected void SetProxyInfo()
        {
            string type    = IniUtil.ReadIniValue(iniPath, "NetConfig", "Type");
            string proxyip = IniUtil.ReadIniValue(iniPath, "NetConfig", "IP");
            string portstr = IniUtil.ReadIniValue(iniPath, "NetConfig", "Port");
            int    port    = 0;

            int.TryParse(portstr, out port);
            string user     = IniUtil.ReadIniValue(iniPath, "NetConfig", "User");
            string password = IniUtil.ReadIniValue(iniPath, "NetConfig", "Passsword");

            if (string.IsNullOrEmpty(type) || type.Equals("不用代理"))
            {
                return;
            }

            this.Proxy             = new WebProxy(proxyip, port);
            this.Proxy.Credentials = new NetworkCredential(user, password);
        }