Ejemplo n.º 1
0
        public static void WriteData(LoginPageCookie loginPageCookie, LoginPageXml loginPageXml)
        {
            var json1 = AESUtil.Encrypt(SerializeUtil.Serialize(loginPageCookie), aesKey);

            using (var fs = File.Open(DataPath + "LoginPageCookie.json", FileMode.OpenOrCreate))
            {
                var data = Encoding.UTF8.GetBytes(json1);
                fs.Write(data, 0, data.Length);
            }
            var json2 = AESUtil.Encrypt(SerializeUtil.Serialize(loginPageXml), aesKey);

            using (var fs = File.Open(DataPath + "LoginPageXml.json", FileMode.OpenOrCreate))
            {
                var data = Encoding.UTF8.GetBytes(json2);
                fs.Write(data, 0, data.Length);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 将实体发送给远程服务器
 /// 发送json
 /// </summary>
 /// <param name="url"></param>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static string Post(string url, Object obj)
 {
     return(WebClientUtil.Post(url, SerializeUtil.Serialize(obj)));
 }