Don't ever mix up file IO and web server. They are not, never have been, and
never will be, the same. Well, maybe "never will be" is a bit overconfident.
System.IO is a namespace for working with file system objects, NOT web
server objects. That means that the file system will never (again, I may be
a bit too bold to say "never") be able to understand a URL. You are in luck
in one sense, however. The ASP.Net HTTPServerUtility has a method which can
translate a URL into a file location: MapPath(). Use Server.MapPath(url) to
convert the URL to a file location, then check if it exists with the correct
path.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:Og**************@TK2MSFTNGP09.phx.gbl...
Ok, I'm trying this but is not working. I'm using a path to and from a
webserver location...should that make a difference?
If (System.IO.File.Exists("../folder/anotherfolder/" & aVariable&
"/adocument.pdf")) Then
pnlIntro.Visible = True
End If
_____
DC G
"Rene Mansveld" <R.********@TAKETHISOUT.Spider-IT.de> wrote in message
news:eF**************@TK2MSFTNGP10.phx.gbl... ...or just use the File class of the System.IO namespace:
If (System.IO.File.Exists(myFile)) Then
myPanel.Visible = True
End If
--
Hope this helps ...
Rene Mansveld
Spider IT - Germany (was Whitworth Software Solutions)
www.Spider-IT.de / www.Spider-IT.net / www.Spider-IT.org /
www.Spider-IT.biz
Please reply to the newsgroup(s) :o)
"Svein Terje Gaup" <st****@broadpark.no.spam> schrieb im Newsbeitrag
news:OG**************@TK2MSFTNGP09.phx.gbl... Dim myFile As FileInfo = New FileInfo(myFileName)
If(myFile.Exists)
myPanel.Visible = True
End If
Sincerely
Svein Terje Gaup
"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:e4**************@TK2MSFTNGP10.phx.gbl...
> How do I test for existence of a file in the file system:
>
> If FileExists(myVariable & ".pdf") = True
> pnlMyPanel.Visible = True
> End If
>
> --
> _____
> DC G
>
>