Method to convert a URL

Posted on 2006-03-19
Last Modified: 2010-04-16
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: "" 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.

Question by:sabrina_spillane
    1 Comment
    LVL 4

    Accepted Solution

    is 'filename' same as 'controlname'?

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


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

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

    String NewPath = "" + 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

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now