• 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();

  • 相关阅读:
    DataTable Clone()方法和Copy()方法的区别
    element-ui的使用
    解决VS Code 软件PowerShell执行策略问题
    Vue-Router
    Vue的生命周期
    vue-cli脚手架和webpack
    Vue组件
    Vue基本用法和指令
    ES6常用语法
    前端-Bootstrap框架
  • 原文地址:https://www.cnblogs.com/hechunming/p/3093217.html
Copyright © 2020-2023  润新知