for (int i = 0; i < distinctProviceCodeYiDong.Length/2; i++)
            {
                string imsi = GetRandom();
                string url = "http://app.gtsmobile.com/GTSBOX_MTK/Charge_Update.aspx?Cstname="+distinctProviceCodeYiDong[i,1]+"_1_" + imsi + "&OriginId=404";
                GetResponse(url,distinctProviceCodeYiDong[i,0]);
            }
public static void GetResponse(string url,string str)
        {
            try
            {
                try
                {                    WebRequest wq = null;
                    Uri uri = new Uri(url);
                    wq = WebRequest.Create(uri);
                    wq.Method = "get";
                    wq.Timeout = 30000;
                    WebResponse rp = wq.GetResponse();
                    Stream stream = rp.GetResponseStream();
                    Encoding encode = Encoding.GetEncoding("utf-8");
                    // Pipe the stream to a higher level stream reader with the required encoding format. 
                    StreamReader readStream = new StreamReader(stream, encode);
                    BinaryReader Breader = new BinaryReader(stream, encode);
                    byte[] readByte = new byte[8000];
                    readByte = Breader.ReadBytes(readByte.Length);
                    StringBuilder strb = new StringBuilder();
                    strb.Append(str+"\n");
                    Rule rule = new Rule();
                     string resule = rule.getMesg(readByte,strb);
                     Console.WriteLine(resule);
                    stream.Close();
                    rp.Close();
                    
                }
                catch (WebException ex)
                {
                    Console.WriteLine(ex.ToString());
                    Console.ReadLine();                }
                
            }
            catch (NotSupportedException ex)
            {                Console.WriteLine(ex.ToString());
            }        }
代码如上,我用循环调用这个GetResponse方法,在控制台中已经完整输出了所有信息,我想把这些信息输出到文本文件中,这个方法要怎样写呢??