且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

打开文本文件并逐行读取

更新时间:2023-12-04 15:56:04

尝试更改文本文件位置驱动器除了c:
Try to change text file Location drive Except c:


它抱怨文件因为运行应用程序的用户无法访问路径的某些部分。这很可能是因为你试图通过网站服务器上的固定地址访问文件。



这里有几件事,但不是明确你应该做些什么来解决它:如果文件在服务器上,那么你不应该试图通过用户路径访问它,因为绝对不能保证你的用户甚至存在于网络服务器上,并且几乎有无论如何,网站都无法在该用户下运行。

该文件也有可能在客户端上 - 在这种情况下,您的代码根本无法访问它,除非它已被上传到首先是服务器,在这种情况下你应该保存在相对于网站的路径中。



我不能在这里提出具体的建议,因为我看不到你的代码!
It's complaining about the file because some part of the path is not accessible to the user that is running the application. Most likely this is because you are trying to access a file via a fixed address on the server of your website.

There are a couple of things here, but it's not obvious what you should do to fix it: if the file is on the server, then you should not be trying to access it via a user path, because there is absolutely no guarantee that your user even exists on a webserver, and there is almost no chance that a website will run under that user anyway.
There is also the chance that the file is on the client - in which case your code cannot access it at all unless it had been uploaded to the server first, in which case you should be saving if in a path relative to the website anyway.

I cannot make concrete suggestions here, because I can't see your code!


访问这里......



http://www.csharp411.com/c-read-text-file-line-by-l ine / [ ^ ]







http://www.homeandlearn.co.uk/csharp/csharp_s11p2.html [ ^ ]
visit Here...

http://www.csharp411.com/c-read-text-file-line-by-line/[^]

or

http://www.homeandlearn.co.uk/csharp/csharp_s11p2.html[^]