获取服务器文件路径(并向TXT写入数据代码)
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();