码迷,mamicode.com
首页 > 移动开发 > 详细

手机端Post 数据

时间:2016-07-13 00:59:00      阅读:525      评论:0      收藏:0      [点我收藏+]

标签:

  var data ="";
            using (StreamReader readStream = new StreamReader(context.Request.InputStream, Encoding.UTF8))
            {
                data = readStream.ReadToEnd();
            }
            var path = Server.MapPath("/UpFile/") + DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt";
            FileStream fs = new FileStream(path, FileMode.Create);
            StreamWriter sw = new StreamWriter(fs);

            sw.Write(string.Format("一共接收{0}个字", data.Count()));
            //开始写入
            sw.Write(data);
            //清空缓冲区
            sw.Flush();
            //关闭流
            sw.Close();
            fs.Close();

手机端Post 数据

标签:

原文地址:http://www.cnblogs.com/change4now/p/5665213.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!