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

  • 相关阅读:
    mem 预留内存
    关于内核反汇编,同时显示源文件
    读些笔记
    platform设备驱动
    glut 右键子菜单
    获取HINSTANCE
    window窗口样式style
    opengl 直线拾取
    glut弹出式菜单
    读取大恒采集卡c++代码
  • 原文地址:https://www.cnblogs.com/hechunming/p/3093217.html
Copyright © 2011-2022 走看看