Virtual Path Error in ASP.NET

I am trying ftp files that I upload to my web server that my website is hosted on.  I can successfully upload the files to a directory on the C:\ drive, but when I try to ftp them and point to them in my code, I am getting the error stating 'C:\...' is not a valid virtual path.

My site is hosted in IIS, so the web files are stored in that location.  I am trying to point to a location that is not in the same root directory.

I've tried ..//, ~/, and several other techniques, but I can't get it to work.

Any Ideas?
jamesdean666Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alfred A.Commented:
Use Server.MapPath
Alfred A.Commented:
Do it something like

Dim FILENAME As String = "C:\websites\" + TextBox1.Text + ".txt"
Alfred A.Commented:
Oops,  I left the server.mappath.  Sorry!

Dim FILENAME As String = Server.MapPath("C:\websites\"  + TextBox1.Text + ".txt")
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Alfred A.Commented:
Oh, Correction from my previous post use relative addressing rather than the one I provided.

Check this out:

http://msdn.microsoft.com/en-us/library/ms524632%28VS.90%29.aspx
Alfred A.Commented:
Example of Virtual Path (relative addressing) using Server.MapPath.

Dim path As String = Server.MapPath("Images/blueWave.JPG")
Dim path As String = Server.MapPath("../Images/blueWave.JPG")
Dim path As String = Server.MapPath("~/Images/blueWave.JPG")

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jamesdean666Author Commented:
Yahtzee.... Thanks...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.