hotkeys for totalcommander

ALT + F5  - create archive

ALT + f6 -  unzip

at element [..] Shift + F6  - edit path to current folder

c# Revocate certificate in CA using CERTADMINLib

1 Add certadmin lib
enter image description here
For this install

Follow these steps:
1.        Click Start , click Control Panel , and then click Programs .
2.        In the Programs and Features area, click Turn Windows features on or off .
If you are prompted by User Account Control to allow the Windows Features dialog box to open, click Continue .
3.        In the Windows Features dialog box:

Expand Remote Server Administration Tools .
Expand Role Admin Tools .
Expand Active Directory Certificate Services Tools .
Check Certificate Authority Tools.

In command prompt type this: "tlbimp certadm.dll"

Usefull links about this

2 Use this code
public static void RevokeCert(string connection,string serial)
    //connection= "\\My-CA"
    //serial = "614870cd000000000014"

    const int CRL_REASON_UNSPECIFIED = 0;

    CERTADMINLib.CCertAdmin _admin = null;
        _admin = new CCertAdmin();
        _admin.RevokeCertificate(connection, serial, CRL_REASON_UNSPECIFIED, DateTime.Now);
        if (_admin != null)

How to automatically run tests c#


For nunit there is a very usefull decision NUnit-Console

Using different parametres you can watch results in text or xml file.

For example

nunit-console /xml:console-test.xml nunit.tests.dll


For MSTEST there is same tool named mstest
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\mstest" /testcontainer:"D:\TeamCity\buildAgent\work\8a4449e52545215c\web\MvcApplication2\MvcApplication2.Tests\bin\Release\MvcApplication2.Tests.dll" /test:AboutTest 

You can choose wich of tests to run by using param /test

Compiling projects without Visual Studio

1 Create bat file in c:\bin\msbuild.bat

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild %1

@echo off

if errorlevel 1 (


2 In notepad++ press F5 and input folowing text (or Run->Run in menu)

C:\bin\msbuild.bat "$(FULL_CURRENT_PATH)"

3 Open sln file, press F5 and enter then

4 Your Code is compiled successfully

It's possible to choose configureation option

msbuild /property:Configuration=Release MyFile.vbproj

Usefull link to stackoverflow

visual studio shortcuts

Shortcut for turning on line numbers

How to Register ActiveX/COM dll in order to use with c#

If the DLL is 32 bit:
Copy the DLL to C:\Windows\SysWoW64\
In an elevated command prompt: %windir%\SysWoW64\regsvr32.exe %windir%\SysWoW64\namedll.dll
if the DLL is 64 bit:
Copy the DLL to C:\Windows\System32\
In an elevated command prompt: %windir%\System32\regsvr32.exe %windir%\System32\namedll.dll
I know it seems the wrong way round, but that's the way it works. See:
Quote: "Note On a 64-bit version of a Windows operating system, there are two versions of the Regsv32.exe file:
The 64-bit version is %systemroot%\System32\regsvr32.exe.
The 32-bit version is %systemroot%\SysWoW64\regsvr32.exe.

In order to solve next problem you have to run cmd as an Administrator
“The module “%1″ was loaded but the call to DllRegisterServer failed with error code 0×80004005. For more information about this problem, search online using the error code as a search term”.


var res = (YourClass)Newtonsoft.Json.JsonConvert.DeserializeObject(s, typeof(YourClass));

string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(o);