zoukankan      html  css  js  c++  java
  • net 当中动态给记事本当中插入值


                    string url = Server.MapPath("dingdan")+"\\";//ConfigurationManager.AppSettings["filepath"].ToString();
                    String fileName = "dingdan"; //DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");//Guid.NewGuid().ToString();
                    String path = url + fileName + ".txt";            
                      
                    FileStream fs = new FileStream(path, FileMode.OpenOrCreate);
                    string body = DateTime.Now.ToString() + (char)13 + (char)10 + "z客户" + Request["name"].ToString() + "的订单内容如下" + (char)13 + (char)10 + ""
                       + "性别:" + Request["sex"].ToString() + (char)13 + (char)10 + ""
                          + "手机:" + Request["phone"].ToString() + (char)13 + (char)10 + ""
                           + "地址:" + Request["addr"].ToString() + (char)13 + (char)10 + ""
                          + "产品:" + Request["chanpin"].ToString() + (char)13 + (char)10 + "";
                    string s = "\n\r" + body + "\n\r";
                    Byte[] ts = System.Text.Encoding.UTF8.GetBytes(s);                 
                     
                     //设定书写的开始位置为文件的末尾  
                     fs.Position = fs.Length;   
                     //将待写入内容追加到文件末尾  
                     fs.Write(ts, 0, ts.Length);      
                        fs.Dispose();
                        fs.Close();
                        GC.Collect();

  • 相关阅读:
    洛谷
    洛谷
    洛谷
    洛谷
    模板
    .
    洛谷
    洛谷
    洛谷
    poj 2955"Brackets"(区间DP)
  • 原文地址:https://www.cnblogs.com/hechunming/p/3093217.html
Copyright © 2011-2022 走看看