Tech Off Thread

5 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Grrrrrr!!!!

Back to Forum: Tech Off
  • User profile image
    josh_harris

    Hi all

    I am having the following problem with the following bit of code

    Dim fs As New IO.StreamReader("C:\SCUD\web\" + (noOfSites + 1).ToString() + ".htm")

    It is in a loop (this is a semi commercial program that I am working on so I cant include all of it), the error is that (from the debugger itself) {"Could not find file \SCUD\web\1.htm'.":"C:\SCUD\web\1.htm"}, the program has generated the file

    thanks


    Joshua Harris

  • User profile image
    Cannot​Resolve​Symbol

    Try escaping your slashes, like "C:\\SCUD\\web\\".

  • User profile image
    Yggdrasil

    CannotResolveSymbol wrote:
    Try escaping your slashes, like "C:\\SCUD\\web\\".


    It's VB.NET, so there's no escaping necessary.

    josh_harris wrote:

    {"Could not find file \SCUD\web\1.htm'.":"C:\SCUD\web\1.htm"}


    Is the exception message, verbatim? I can't understand the syntax.

    One thought - if it's a different part of your program that is generating these files, could it be that for some reason it wasn't generated, or that the StreamWriter (or whatever) used to create it wasn't closed/disposed properly and thus left the file open and in use?
    If you go to C:\SCUD\web\ in Windows Explorer, is the file there? Can you open it? Can you edit it?

  • User profile image
    W3bbo

    Yggdrasil wrote:
    One thought - if it's a different part of your program that is generating these files, could it be that for some reason it wasn't generated, or that the StreamWriter (or whatever) used to create it wasn't closed/disposed properly and thus left the file open and in use?
    If you go to C:\SCUD\web\ in Windows Explorer, is the file there? Can you open it? Can you edit it?


    Does the application have permission to read/open the file?

  • User profile image
    SlackmasterK

    \SCUD\web\1.htm'.":"C:\SCUD\web\1.htm"


    This file does exist, right?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.