MapPath & Windows Forms

  • Thread starter Thread starter Jeffrey A. Voigt
  • Start date Start date
J

Jeffrey A. Voigt

Is it possible to use the HttpUtility.MapPath functionality in a windows
forms environment? I'm reading in some xml project files and the paths are
sometimes http:// (virtual directories). I want to translate it into a
physical directory, but I can't because my application doing this is a
windows forms application? I cannot use the HttpUtility object in that
environment, or at least, I have not figured out how to do so? How can this
be done??

Thanks,
- J
 
Jeffrey said:
Is it possible to use the HttpUtility.MapPath functionality in a windows
forms environment? I'm reading in some xml project files and the paths are
sometimes http:// (virtual directories). I want to translate it into a
physical directory, but I can't because my application doing this is a
windows forms application? I cannot use the HttpUtility object in that
environment, or at least, I have not figured out how to do so? How can this
be done??

Thanks,
- J
Because you're not hosting your asp.net runtime in your windows forms,
it has no way of knowing which url map to which file.

If you really need to integrate with iis, your best luck is using WMI to
read the data from IIS itself, finding the vdir and then the file
itself. Am afraid i have no examples of that, but I'm sure google knows
better than me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top