Reverse Those Short URLs

2. February 2011 02:58

ASP.NET Utils 

Bit.ly is one of the major short URL service provider. There are other also but Bit.ly is used by most of the users because of it's simplicity, API and statistics. But some notorious users create short URLs for the spam sites which doesn't make any sense to us. As you know by looking at the short URLs, they won't reveal anything. But there is a way to get the original/long URL through ASP.NET.

Below is the method which takes short URL as a parameter.

public static string ReverseShortURL(string ShortURL)
{
        HttpWebRequest Webrequest = (HttpWebRequest)HttpWebRequest.Create(ShortURL);
        HttpWebResponse Webresponse = (HttpWebResponse)Webrequest.GetResponse();
        Uri uri = Webresponse.ResponseUri;
        return uri.AbsoluteUri;
}

The Response.Uri will get the actual URL which is being requested.

 

Demo: http://demo.midnightprogrammer.net/ASPNET/ReverseURL/Default.aspx

Download: ReverseShortURL.zip (335.87 kb)

 No Rating

Windows 7 Logon Screen Changer

29. May 2010 22:42

C# Projects Utils Windows 

Recently I was reading an article on some Windows 7 forums on how to change Windows Logon Background. There are manual steps which helps me to change the longon background, but its tedious if I have to do it manually everytime. So I decided to make a tool which can do it for me. 

I start up a new project in Visual Studio 2010 and create a new windows application. I am not writing about how I did it, I am just giving away this tool for use. Just Browse and click Change Logon Screen and you are done.

Press WIN+L to lock your computer and check your new logon screen. There is only one limitation, you cannot select an image which is larger than 256KB.

I will be uploading the complete source code at codeplex shortly. So keep an eye on the update.

Download: Win7 LogonScreenChanger.zip (49.21 kb)

Source Code: Win7LogonScreenChanger.zip (139.44 kb)

Currently rated 1.0 by 2 people

How To Build UAC Compatible Application In .NET

23. May 2010 21:01

C# Utils Visual Studio Windows 

We all know about a feature called User Account Control (UAC) which introduced with the launch of Windows Vista. By default, UAC is enabled and provides users a better and safer computing experience, but most of the users find it irritating when the UAC prompts everytime they try to run a program. Disabling UAC is not recommended at all.

With UAC enabled programmers find it difficult to access some of the locations on the local drive. Programatically you cannot write or create a file or directory in root partition, inside Program Files, System32 folder and some other locations. Recently I ran into a same problem where I have to access System32 folder, create new folders and copy files from one location on my system to this folder. With UAC disabled this is pretty easy, no security settings and no runtime errors or exceptions. Usually you cannot ask the users to disable UAC and then use the application, so therefore I made my application compatible with UAC and YES!!! you will be prompted with the confirmation box to run the application with administrator privileges. In Windows Vista and Windows 7, even if you are an administrator of your machine you do not have the complete access to resources even if you are an administrator. So in order to make your application run with full administrator rights follow the steps below. This will work the same if you run your application with "Run as Administrator" option which you see when you right-click the application.

Create a new application in Visual Studio. Right-click project and add a new item.

From the Add New Item box select Application Manifest File.

In the manifest file un-comment the following line:

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

Build your applicaton....and when the build is complete you will see the security shield icon accompanying your application icon. A dialogue box appear in front of the user to run the application with full administrative privileges.

Currently rated 4.5 by 2 people

Windows Live Writer and BlogEngine.NET

30. March 2010 14:57

BlogEngine.NET Utils 

WinLiveWriter When I started blogging last year, I used to blog the old traditional way, using admin panel and then drafting my post and that too with minimal features that can be available for blogging. The I heard about Windows Live Writer and without thinking I switch over to Live Writer. Though my early experience with Live Writer was not good and some of my posts looked weird after I post them to my blog. May be I was not that too familiar with Live Writer at that time and I drop the idea of using Live Writer to blog….but now I am and much aware about the power of Live Writer.

I am writing this post with Live Writer and that too loaded with some excellent plug-ins which allow me to do what I need to.

If you are blogger and still using the same old admin panel to blog with seriously limited features then this tool is meant for you. I am late to use this tool for blogging, but you should not.

Download the offline installer of Windows Live Essentials which includes other Live services.

Currently rated 3.5 by 2 people

Visual Studio Theme Generator

24. March 2010 01:15

Utils Visual Studio 

I just Got bored looking at the same code editor in Visual Studio. Same old white background and same syntax colour highlighting. So I give it a go and jump to Visual Studio options and start playing around with the option available to change the look and feel of the code editor. After trying for a while and working around with some customizations, I gave a second go and do a quick bing search in a hope that I will find some theme for my Visual Studio and Voila! I got one, not a theme but a tool indeed which allows me to customize theme as I want and the name is Visual Studio Theme Generator. It's an online free tool with some simple controls on the page which helps you in customizing your code editor by changing the main colour, background colour, foreground colour and also set he contrast. The tool also gives you the option to choose from a variety of colours. You can see the screenshot of this online tool below.

Make some customizations and click the Refresh button on the top right corner of the page to reflect the changes. Once you are finish with the customizations you can then hit the Create button to save you Visual Studio theme settings, save it to your local disk and import it using Import/Export settings wizard in Visual Studio.

I have downloaded the default theme from the page and here is how my Visual Studio code editor looks like now:

NOTE: You can read the detailed step on the website to import the settings. But before you can import the settings it is recommended that you first take the backup of your current/original Visual Studio settings. This tool is a work of javascript so before you hit it make sure you have javascript enabled for you browser.

 No Rating