用StreamReader读取服务器端文本文件,或远程网页 放在WebService中,返回字符串,使得ajax解析方便。 [WebMethod] public string getFile(string fn){ string str=""; string line=""; StreamReader sr = new S
1、直接采用Open函数+Line input命令 Private Sub txt_read()Dim txt As StringOpen "D:\dzh.txt" For Input As #1 ''对文件做任何 I/O 操作之前都必须先打开文件。Open 语句分配一个缓冲区供文件进行 I/O 之用,'并决定缓冲区所使用的访问方式