namespace AsiaINFO.SMS.CMPP2 { using System; public class StateDictionary { public static string ConnResDictionary(uint state) { string str = "连接结果:"; switch (state) { case 0: return (str + "成功!"); case 1: return (str + "错误! 原因:消息结构错"); case 2: return (str + "错误! 原因:非法源地址"); case 3: return (str + "错误! 原因:认证错误"); case 4: return (str + "错误! 原因:版本太高"); case 0x3e5: return (str + "错误! 原因:连接超时"); case 0x3e6: return (str + "错误! 原因:远程服务器主动断开"); case 0x3e7: return (str + "错误! 原因:未知错误"); } return ("错误! 原因:其他错误" + state.ToString()); } } }