C# simple class to convert a URL into acceptable windows file name


Hi, i was working on a project that takes screen-shots of web pages that are loaded in to Internet Explorer browser.As per the clients requirement, I need to save the screen-shot of a web page using the later ‘s URL.
I searched the web to find some help, but found nothing that matches my criteria, then i decided it do it my own way, write your own class file for converting a URL into an acceptable windows filename.
here is the code that will change a URL into a filename.

To use the code, copy this code into your project, and declare an object of the class and call the ConvertToWindowsFileName method.

Advertisements