Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading XML file
Message
De
20/09/2004 13:43:52
 
 
À
20/09/2004 11:11:36
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00944026
Message ID:
00944093
Vues:
22
Jerry,

>I have a ASP.Net webform that reads an xml file on Page_Load(). This xml file exists in the same directory on the web server as the .ASPX file. However, my .ASPX can't find the xml file unless I specify the full path the xml file.
>Is there a way to find the xml file without using the fullpath?

I don't know if you can specify the XML filename without a path, but if you need to dynamically find the path you could perhaps use a method of the Request object to find at least the physical path of the virtual dir. To demonstrate, you could put this into the Page_load of a Webform:
Response.Write("Request.PhysicalApplicationPath(): " & _
Request.PhysicalApplicationPath() & "<br>")
Based on this, you should be able to use Request.PhysicalApplicationPath(), which returns a string, as part of your path\filename parameter.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform