I am working with VWD 2010 Express and VB. When the page is on the local server the following statement works pretty well:
'This part handle the pictures presentation
'Dim PicturesPathVariable As String = "c:\bPhones\UploadedImagesClassifieds\"
However when the page in on the remote server I do have to use this one:
'Dim PicturesPathVariable As String = "e:\HostingSpaces\3040bG\bPhones.com\wwwroot\UploadedImagesClassifieds\"
The point here is that I want to have uniformity between the local and remote coding in order to avoid confussion. So, is there any way that I can use wild characther to represent the part before the \UploadedImagesClassifieds\: ........................
????????????????? .........................\UploadedImagesClassifieds\"
I tried something like ~\UploadedImagesClassifieds\" ; or * \UploadedImagesClassifieds\" and ? \UploadedImagesClassifieds\"
Member
58 Points
382 Posts
Need help with wildcard characters
Jul 06, 2013 12:02 PM|vstorpedo|LINK
I am working with VWD 2010 Express and VB. When the page is on the local server the following statement works pretty well:
'This part handle the pictures presentation
'Dim PicturesPathVariable As String = "c:\bPhones\UploadedImagesClassifieds\"
However when the page in on the remote server I do have to use this one:
'Dim PicturesPathVariable As String = "e:\HostingSpaces\3040bG\bPhones.com\wwwroot\UploadedImagesClassifieds\"
The point here is that I want to have uniformity between the local and remote coding in order to avoid confussion. So, is there any way that I can use wild characther to represent the part before the \UploadedImagesClassifieds\: ........................ ????????????????? .........................\UploadedImagesClassifieds\"
I tried something like ~\UploadedImagesClassifieds\" ; or * \UploadedImagesClassifieds\" and ? \UploadedImagesClassifieds\"
But nothing work. Can anybody help me. Thanks
Star
11795 Points
2340 Posts
Re: Need help with wildcard characters
Jul 06, 2013 12:07 PM|urenjoy|LINK
try following:
Dim PicturesPathVariable As String = System.Web.HttpContext.Current.Server.MapPath("~/UploadedImagesClassifieds")
You might want to see following:
http://stackoverflow.com/questions/275781/server-mappath-server-mappath-server-mappath-server-mappath