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

Method to convert a URL

I have a public method created that needs to convert a file on my S: drive to a URL? For example my path is S:\foldername\filename and i need to convert this to the following URL: "http://www.myurl.com/controlname" This is all in C#, DotNetNuke. HAs anyone example sourcecode or any ideas in how I would do this. Thanks again in advance for all the help.

0
sabrina_spillane
Asked:
sabrina_spillane
1 Solution
 
SmithJWCommented:
is 'filename' same as 'controlname'?

If so, you can splut the 'path' string using

thePath.Split('\');

that will return an array of Strings, the last of which will be 'FileName'

then you can just append that to myurl.com, e.g.


String NewPath = "http://www.myurl.com/" + the last arrayindex from thePath.split

converting that to a function is an exercise for yourself, but if you need any more help, i can knock it together
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

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