Tips and Tricks in a world of Mix

Archive for the ‘Windows’ Category

Encrypt–Decrypt connectionString

public static void Encrypt(){

           Configuration objConfiguration = null;

           if(HttpContext.Current!=null)        //if we are in web application of some sort

               objConfiguration = WebConfigurationManager.OpenWebConfiguration (“~”);

           else       ///if not web

                objConfiguration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

           ConfigurationSection objSection = “connectionStrings”;

           //if encrypted already don’t do it again

           if(objSection!=null && !objSection.SectionInformation.IsProtected){

                           objSection.SectionInformation.ProtectionSection(string.Empty);

                           objSection.SectionInformation.ForseSave = true;

                          objConfiguration.Save(ConfigurationSaveMode.Full);

           }     

}

 

public static void Encrypt(){

                     Configuration objConfiguration = null;

                       if(HttpContext.Current!=null) //if we are in web application of some sort

                                   objConfiguration = WebConfigurationManager.OpenWebConfiguration (“~”);

                       else ///if not web

                                    objConfiguration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

                      ConfigurationSection objSection = “connectionStrings”;

                           //if encrypted then decrypt

                            if(objSection!=null && !objSection.SectionInformation.IsProtected){

         objSection.SectionInformation.UnprotectSection();

  //objConfiguration.Save();  – you can save the change but it will reset all the global data of your application in iis (relevant to comment it for web applications,can stay on in others)

}

}

Advertisements

Windows 7 64 bit – microphone suddenly stopped working

I’ve tried uninstalling the microphone and restarting the computer .

I’ve tried all kind of reconfigurations of the volume settings in the control panel .

Well after about hundred posts the solution was easy –

(more…)

The (SAMAccountName=) search filter is invalid

Starting a website got this error.

Untitled4

 

It means that Authentication level in IIS is not the right one .

It also means that probably you didn’t add all the needed features to IIS.

go to :

Start –> Control Panel –> Programs –>

(more…)

HTTP Error 404.17 – Not Found (404.3) – Asp.Net mime types missing

OS: Windows 7 x64 bit

IIS : 7.5

You are opening your web site and there it is :

Untitled

It’s coming with enigmatic messages like this :

Untitled1

So , if take a closer look , the only world that matters here is the “MIME” – that means that some handler of the pages you want to show is not installed properly on your IIS.

I was only trying to show

(more…)

Error on entering Services–“One or more activex controls could not be displayed because either”

 

image

 

Here is the solution given  by Microsoft :

You should delete 1 extra (parasite) zone from HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\
with pseudo-graphic number, you’ll see it before zone number 0.
The pseudo-graphic number they speak of before zone number 0 looks like a miniature upper case "L".

The error stops after restarting the computer .

Tag Cloud

%d bloggers like this: