根据网络地址 本地怎么能用winform浏览a.doc内容

根据网络地址, 比如 http://aaa.c.com/a.doc 本地怎么能用winform浏览a.doc内容

新人好像不能看懂你的問題,網絡地址好像不懂。你讀取本地文件當然要本地路徑了,我今天做了一個簡單的在text中顯示任意格式文件的內容,在點擊按鍵
事件中添加以下代碼

            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Title = "請選擇要打開的文件";
            ofd.InitialDirectory = @"C:\Users\Administrator\Desktop\新建文件夹";
            ofd.Filter = "文本文件|*.txt|所有文件|*.*";
            ofd.ShowDialog();

            string path = ofd.FileName;


            if (path == "")
            {
                return;
            }
            load = path;
            recodes .Add (Path .GetFileName (path ) );
            using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
            { 
            byte [] buffer = new byte [1024*1024*6];
            int r = fs.Read(buffer ,0,buffer.Length );
            textBox1.Text = Encoding.Default.GetString(buffer ,0,r);
            }

在text中顯示你打開的任意文件的內容。新人不喜勿噴。