很难尝试打开文本文件 [英] Having a hard time trying to open a text file

查看:84
本文介绍了很难尝试打开文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。


我用VS.NET开发了一个使用Web应用程序/表单程序的Web页面

2003,VB,.Net Framework 1.1.4322, ASP.NET 1.1.4322,IIS 5.1。

使用此代码打开一个简单的文本文件。如果我的程序中出现错误

文件打开一次后,它会给我一条消息说

" System.IO.IOException:文件已经打开。


FileOpen(1," C:\ xmltrips.txt",OpenMode.Output,OpenAccess.Write)


WriteLine (1,txtFilStr)


当我尝试删除它时,它会说它正由另一个人使用或

程序。


如果它正在打开输出,那为什么不会一次又一次打开?


我有一个FileClose(1)in我们非常感谢任何帮助。


谢谢,

Tony

Hello.

I developed a web consuming windows application/form program with VS.NET
2003, VB, .Net Framework 1.1.4322, ASP.NET 1.1.4322, IIS 5.1.

Using this code to open a simple text file. If i get an error in my program
after the file has been opened once, it gives me a message saying
"System.IO.IOException: File already open."

FileOpen(1, "C:\xmltrips.txt", OpenMode.Output, OpenAccess.Write)

WriteLine(1, txtFilStr)

When i try to delete it, it says "It is being used by another person or
program".

If it''s being opened output, then why won''t it open again and again ?

I have a FileClose(1) in the catch statement.

Any help would be gratefully appreciated.

Thanks,
Tony

推荐答案

" Tony Girgenti" < tony(nospam)@ lakesideos.com写信息

新闻:uz ************** @ TK2MSFTNGP05.phx.gbl ...
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:uz**************@TK2MSFTNGP05.phx.gbl...

你好。


我用VS.NET开发了一个使用Windows应用程序/窗体的web程序

2003, VB,.Net Framework 1.1.4322,ASP.NET 1.1.4322,IIS 5.1。


使用此代码打开一个简单的文本文件。如果我在打开文件后在我的

程序中出现错误,它会给我一条消息说

System.IO.IOException:文件已经打开。


FileOpen(1," C:\ xmltrips.txt",OpenMode.Output,OpenAccess.Write)


WriteLine (1,txtFilStr)


当我尝试删除它时,它会说它正由另一个人使用或

程序。


如果它正在打开输出,那为什么不会一次又一次打开?


我有一个FileClose(1)in捕获声明。


任何帮助将不胜感激。
Hello.

I developed a web consuming windows application/form program with VS.NET
2003, VB, .Net Framework 1.1.4322, ASP.NET 1.1.4322, IIS 5.1.

Using this code to open a simple text file. If i get an error in my
program after the file has been opened once, it gives me a message saying
"System.IO.IOException: File already open."

FileOpen(1, "C:\xmltrips.txt", OpenMode.Output, OpenAccess.Write)

WriteLine(1, txtFilStr)

When i try to delete it, it says "It is being used by another person or
program".

If it''s being opened output, then why won''t it open again and again ?

I have a FileClose(1) in the catch statement.

Any help would be gratefully appreciated.



什么是FileOpen和FileClose?我不认识他们


John

What are FileOpen and FileClose? I don''t recognize them

John


你好约翰。


我从这里复制了所有内容:
http://msdn.microsoft.com/library/de.../vastmOpen.asp


谢谢,
Tony


" John Saunders" < john.saunders at trizetto.comwrote in message

news:%2 **************** @ TK2MSFTNGP02.phx.gbl ...
Hello John.

I copied everything from here:
http://msdn.microsoft.com/library/de.../vastmOpen.asp

Thanks,
Tony

"John Saunders" <john.saunders at trizetto.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...

" Tony Girgenti" < tony(nospam)@ lakesideos.com写信息

新闻:uz ************** @ TK2MSFTNGP05.phx.gbl ...
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:uz**************@TK2MSFTNGP05.phx.gbl...

>您好。

我开发了一个使用VS.NET的Web应用程序/表单程序,2003,VB,.Net Framework 1.1 .4322,ASP.NET 1.1.4322,IIS 5.1。

使用此代码打开一个简单的文本文件。如果我在打开文件后在我的
程序中出错,它会给我一条消息,说明
System.IO.IOException:文件已经打开。

FileOpen(1," C:\ xmltrips.txt",OpenMode.Output,OpenAccess.Write)

WriteLine(1,txtFilStr)

当我尝试删除它,它说它正被另一个人使用或
程序。

如果它正在打开输出,那么为什么不再打开它再次?

我在catch语句中有一个FileClose(1)。

任何帮助都将不胜感激。
>Hello.

I developed a web consuming windows application/form program with VS.NET
2003, VB, .Net Framework 1.1.4322, ASP.NET 1.1.4322, IIS 5.1.

Using this code to open a simple text file. If i get an error in my
program after the file has been opened once, it gives me a message saying
"System.IO.IOException: File already open."

FileOpen(1, "C:\xmltrips.txt", OpenMode.Output, OpenAccess.Write)

WriteLine(1, txtFilStr)

When i try to delete it, it says "It is being used by another person or
program".

If it''s being opened output, then why won''t it open again and again ?

I have a FileClose(1) in the catch statement.

Any help would be gratefully appreciated.



什么是FileOpen和FileClose?我不认识他们


John


What are FileOpen and FileClose? I don''t recognize them

John



" Tony Girgenti" < tony(nospam)@ lakesideos.com写信息

新闻:Oo ************** @ TK2MSFTNGP05.phx.gbl ...
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:Oo**************@TK2MSFTNGP05.phx.gbl...

你好约翰。


我从这里复制了所有内容:
http://msdn.microsoft.com/library/de。 ../vastmOpen.asp



我明白了。我从来没有用过这些。祝你好运。


John

I see. I''ve never used these. Good luck.

John


这篇关于很难尝试打开文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆