string s=Server.MapPath("..\\..\\api\\text.txt"); //由相对路径获取物理路径 FileStream fs = new FileStream(s, FileMode.Create); byte[] data = new UTF8Encoding().GetBytes("notify_url"); fs.Write(data, 0, data.Length); fs.Flush(); fs.Close();
获取服务器文件路径(并向TXT写入数据代码),布布扣,bubuko.com
原文:http://www.cnblogs.com/huangtu/p/3586426.html