Thursday, August 14, 2008

Encrypting ConnectionString in web.config

To work-out this sample you need to include System.Web.Configuration namespace.

Code:

using System.Web.Configuration;

// Open web.config file
Configuration config = WebConfigurationManager.OpenWebConfiguration("~");

// Get the ConnectionString section
ConnectionStringsSection section = config.GetSection("connectionStrings") as ConnectionStringsSection;

// Toggle Encryption
if (section.SectionInformation.IsProtected)
{
section.SectionInformation.UnprotectSection();
Response.Write("Connection String Encryption Removed");
}
else
{
section.SectionInformation.ProtectSection("DataProtectionConfigurationProvider");
Response.Write("Connection String Encrypted");
}

// Save changes to web.config file
config.Save();

Note:
Include this code in a Page-Load or in a Button-Click. The code sample toggles encryption-decryption. This is a code sample from MSDN.

Tuesday, August 5, 2008

unable to SHUTDWON computer after HIBERNATION in Vista

Recently, I encountered a problem in my Vista Ultimate with SP1.

Scenario

Due to power-failure, i's forced to hibernate my Vista system. Once the power comes back, I rebooted my system. It seems to work as normal. I dont find anything strange. But, when I gave a SHUTDOWN command from Start -> Shutdown. I's surprised by the way Vista behaved.

Every display was as usual. I got a screen showing 'Logging Off', then a 'Shutting Down' screen. And my LCD monitor got OFF and showed 'No Signal'. But, I noticed that my PC is not powered-off completely. Instead I can see the light of the SMPS lite & can hear my CPU fan running.

All I've to do is to turn-off the power manually. I googled for sometime & everyone had enountered the same issue (mostly during SLEEP than HIBERNATE). But I cant find a clear answer.

I also noticed that START -> RESTART is working fine. But, START-.SHUTDOWN has still problem. My situation turned pathethic. I even tried restoring to a previous settings. But everything was in-vein. As a temporary solution, i created a batch file which calls the 'shutdown.exe' from the System32 folder of the Windows directory (as 'shutdown -s'). To my luck, it worked fine.

Solution

Finally, I got a solution to sove this. I got this as a trial-and-error method. I manually shutdown the PC using shutdown.exe utility of Vista OS.

For this I created a batch file, with following contents inside it.



OR

Just type

shutdown -s

in your console screen or in your RUN window.

You'll get a warning that your PC will shutdown after 1 minute.


Note: This method may fail for first time (sometimes). If its failed, then restart the machine & try it again. It will work. Guranteed!

Saturday, August 2, 2008

Is 'Cuil' cool ?

August 1, 2008 - A milestone was laid my installing Cuil into the Internet Search Industry. Though Google rules the search-industry, lets here what Cuil has to say.

"We'd indexed 12billion web-pages, which is larger than any existing search engine (including Google)"

This was how Google came to the internet search industry, years back. They made a large set of indexes (via distributed servres) globally. And with the help of their powerful search algorithm, they clipped the web-pages, faster than anyone.

The exact idea was implemented the Cuil team. Oh! forgot to introduce the Cuil team- consisting of former Google engineers and others who worked at eBay, Altavista & IBM.

Holding 12billion index is not a bad thing.

First time when i used Cuil, i's doubted whether I'm using Wikipedia. Because no spelling suggestion is available. Later only I came to know that their searching mechanism is quite new. A new approach, but partially similar to Wikipedia.

I tried searching 'ASP.NET Official Forum'. My expectation was to get http://forums.asp.net, but I got some other search links. What I noticed here ia that, each search result is embedded in a box along with a screenshot.

Then, I tried another way searching the same thing, by making a small mistake, like this 'ASP.NET Oficial Forum'. Wow! to my surprise, I got the official asp.net forums link as the first result, along with a screenshot.

I dont know why that spelling-mistake has pushed-up the original link & why the original search-term hides the original link.

If you know the exact search-term, you'll have the exact result. But, what I felt was that the results are based on contents & relevance, rather than popularity and audience traffice.

That's why I mentioned, that I felt like Wikipedia. I've thought a long time, that if the wikipedia's search is powered by google, then how easy it will be to find an article in Wikipedia. Also, this would have prevented Google from releasing Knol, to beat Wikipedia. Anyway, its a monopoly, i justed mentioned my doubt, thats all.

The search result in Cuil is limited to few pages, as comapired with Google.

There I stopped & loaded Google. I dont find any better search engine than Google.

Might Cuil have some different approach than google. But, all it lies on how the end-user understands it, how they suits it.

Will the black background of Cuil, can corrupt Google ?

How far will Cuil be in our browser.

Will Cuil strike at the right Chord ?

Lets show continues...!!!

My Best Sites & Forums

The best sites, forums, blog that I like the most.

Official

MSDN (C#)

ASP.NET Forum

MSDN (ASP.NET Developer Center)

MSDN (C# Developer Center)

MSDN Developer Center

Other Links

DotNETSlackers

EggHeadCafe

CodeProject

Certification

CertRead

Best Sites for Technical NewsLetter(s)

I found some nice portals where you can subscribe for newsletter, about IT World, Technical Papers, and so on...

CNet
ZDNet
TechRepublic
CodeProject
 
Best viewed in Internet Explorer 8.