Tag Archives: csharp
Get MAC Address with C#

public string GetLocalIPAddress() { foreach (NetworkInterface NetI in NetworkInterface.GetAllNetworkInterfaces()) { if (NetI.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || NetI.NetworkInterfaceType == NetworkInterfaceType.Ethernet && NetI.OperationalStatus…

Get local IP address with C#

public string GetLocalIPAddress() { foreach (NetworkInterface NetI in NetworkInterface.GetAllNetworkInterfaces()) { if (NetI.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || NetI.NetworkInterfaceType == NetworkInterfaceType.Ethernet && NetI.OperationalStatus…

How to get bios identifier with C#

public string GetBiosId() { try { string bios = ""; using (ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_BIOS")) {…

Explorer theme for ListView control

[DllImport("uxtheme.dll", CharSet = CharSet.Unicode)] public extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList);   //overwrite control’s OnHandleCreated method protected…

Compute hash values for files in c#

MD5: using (MD5 md5 = MD5.Create()) { using (FileStream stream = File.OpenRead(filename)) { return BitConverter.ToString(md5.ComputeHash(stream)).Replace("-", "").ToLower(); } }using (MD5 md5…

Get Processes and Windows using C#

Add a reference in your project to System.Management namespace. Windows API: private delegate bool EnumWindowsProc(IntPtr hWnd, int lParam); [DllImport("user32.dll")] static…

Get Windows version, Architecture and Service pack

Let’s see how can we get Windows Version, CPU architecture and Windows Service Pack in Windows using C#. We are…

Encrypting communication between C# and PHP with Rijndael 256

PHP Encryption $iv_to_pass_to_decryption = ”; function encrypt($text, $key) { $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_RAND); $iv_to_pass_to_decryption = base64_encode($iv); return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key,…

Send message to Skype contact using C#

Let’s see how can we send a message in Skype from a C# application. I chose skype just for the…

C# | Put time consuming operations in thread

Assuming that we have a time consuming operation in a function called TimeConsOperation. To execute it in a separated thread…

Previous Page · Next Page