//写入代理服务器
string temp=this.comboBoxPROXY.Text;
string[] mapi=temp.Split(new char[] { '|' });
 FileStream fs=new FileStream("data\\"+thisuser+"\\"+usr+"\\server.txt", FileMode.Create);
StreamWriter sw = new StreamWriter(fs,Encoding.GetEncoding("gb2312"));
//开始写入
sw.Write(mapi[1]+" "+mapi[2]+" "+mapi[3]+" "+mapi[4]);
//清空缓冲区
sw.Flush();
//关闭流
sw.Close();
fs.Close();




说明:该段代码直接从项目中摘录,参考时请注意一些细节。这里省略了命名空间