If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Can not find file under specified path

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-27-04, 16:04
flc flc is offline
Registered User
 
Join Date: Apr 2004
Posts: 5
Can not find file under specified path

Hi,
I'm using vb.net and read file from "C:\Data\text1.txt".
But I got the message said:
Could not find file "C:\WINNT\system32\text1.txt".
How would this happened?
Can somebody help?
Thanks.


Here're the error message:
-----------------------------------------
Could not find file "C:\WINNT\system32\text1.txt".
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not find file "C:\WINNT\system32\text1.txt".

Source Error:


Line 5: Private itemString
Line 6: Public Overloads Function GetItemString(ByVal value As String) As String
Line 7: Dim fs As New FileStream(value, FileMode.Open, FileAccess.Read)
Line 8: Dim sr As New StreamReader(fs)
Line 9:


Source File: c:\inetpub\wwwroot\ISIS1\FileReader.vb Line: 7

Stack Trace:


[FileNotFoundException: Could not find file "C:\WINNT\system32\text1.txt".]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +181
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) +888
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) +43
ISIS1.FileReader.GetItemString(String value) in c:\inetpub\wwwroot\ISIS1\FileReader.vb:7
ISIS1.Enum1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\ISIS1\Enum1.aspx.vb:51
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On