Пример #1
0
 /// <summary>
 /// 测试连接
 /// </summary>
 /// <returns></returns>
 public static bool HelloWorld(string Server, string Port, out string msg)
 {
     try
     {
         TransService TestClass = new TransService();
         TestClass.Url = @"http://" + Server + ":" + Port + @"/TransService.asmx";
         string            json = TestClass.HelloWorld();
         MMessage <string> mmsg = Converter.Deserialize <MMessage <string> >(json);
         msg = mmsg.Text;
         return(true);
     }
     catch (Exception ex)
     {
         msg = "连接错误:" + ex.Message;
         return(false);
     }
 }