| 发表于:2007-05-29 08:41:331楼 得分:20 |
原因就是写错了。 public shared sub main() dim path as string = "c:\temp\mytest.txt " try if file.exists(path) then file.delete(path) end if dim sw as streamwriter = new streamwriter(path) ' sw.writeline( "this ") sw.writeline( "is some text ") sw.writeline( "to test ") sw.writeline( "reading ") sw.close() dim sr as streamreader = new streamreader(path) do while sr.peek() > = 0 console.writeline(sr.readline()) loop sr.close() catch e as exception console.writeline( "the process failed: {0} ", e.tostring()) end try end sub | | |
|