• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

Cannot Point to Server Path in c# code

This code worked in VS 2008.

// Get most recent available file
            string strSourcePath = "D:\\inetpub\\stockpickermax\\Data\\";  // This is a folder on the host server

            if (!Directory.Exists(strSourcePath))
            {
                strSourcePath = "C:\\Develop\\Apps\\StockPro\\Data\\";
            }

The host folder was confirmed to exist.  I can copy files to the host folder using Cute FTP

What is inetpub?

This code worked for 3 years without a problem.

I just installed IIS for Windows 8.

Suggestions please?

Thanks,
0
Dovberman
Asked:
Dovberman
  • 4
  • 2
2 Solutions
 
Kyle AbrahamsSenior .Net DeveloperCommented:
It might be the C drive.

The default path for the WWWroot IIS

is c:\inetpub\wwwroot

If you're not finding the folder the application may not have permissions to it.
0
 
DovbermanAuthor Commented:
I just found out that I need to write # statements for an ftprequest.

Can you point me to a resource?

Thanks,
0
 
Kyle AbrahamsSenior .Net DeveloperCommented:
that's a completely different question.  

Not sure what you mean by "# statements" but here's how MS reccommends doing it:
http://msdn.microsoft.com/en-us/library/ms229711.aspx
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
DovbermanAuthor Commented:
Typo: Should be c# statements.  I can submit this as a new question.

I will try FtpWebRequest methods tomorrow and give you feedback.

Thanks,
0
 
DovbermanAuthor Commented:
Yes, The FtpWebRequest methods worked.

Thanks
0
 
DovbermanAuthor Commented:
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now