예제 #1
0
        public static bool ReadConfig(HostData w)
        {
            string jsondata;

            try
            {
                // FileStream file = new FileStream(".\\config\\ASF.json", FileMode.Open);
                StreamReader sr = new StreamReader(".\\config\\ASF.json", Encoding.Default);
                jsondata = sr.ReadToEnd();
                sr.Close();
            }
            catch (IOException e)
            {
                Console.WriteLine(e);
                return(false);
            }

            JsonPaserWeb json = new JsonPaserWeb();
            Data         s    = json.Deserialize(jsondata);

            w.chost     = s.WCFHost;
            w.chostport = s.WCFPort;
            return(true);
        }
예제 #2
0
 //初始化
 internal static void Init(HostData h)
 {
     Host     = h.chost;
     HostPort = string.Format("{0}", h.chostport);
 }