Archive for July, 2007

My Latest article ‘DataTable filter demonstation’

My latest article ‘DataTable filter demonstation’ is available at codeproject.com.

Link: http://www.codeproject.com/useritems/DatasetFilter.asp
VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)

Leave a Comment

MSN Bots for MSDN and Encarta

Add MSDNBuddy [at] hotmail.com to your MSN to use your messenter as fast MSDN search.
Also, add encarta [at] botmetro.net to get answers from Encarta.
Here are reference links:
http://blogs.sqlxml.org/vinodkumar/archive/2007/06/07/msdn-bot.aspx
http://vasudevg.blogspot.com/2007/06/encarta-instant-answers.html
VN:F [1.1.6_502]Rating: 1.0/5 (1 vote cast)

Leave a Comment

MD5 with t-sql

You can use HashBytes to achieve.
Check this for reference: http://msdn2.microsoft.com/en-us/library/ms174415.aspx
SELECT
HashBytes(’MD5′, ‘Praveen’),
HashBytes(’MD5′, ‘PraveeN’),
‘0xD09C2ECC3DFCDC8C8D921B589097FCB1′,
CASE WHEN convert(int,HashBytes(’MD5′, ‘PraveeN’)) = 0xD09C2ECC3DFCDC8C8D921B589097FCB1
THEN
‘Success’
ELSE
‘Failed’
END
Note: for MySQL you have MD5() function
VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)

Leave a Comment

MD5 encryption with c#

This code shows how to encrypt a string with MD5 algorithm:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
using System.Text;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
[...]

Leave a Comment

Get Environment Variables

This code will show list of Environment Variables in Windows:

foreach (DictionaryEntry de in Environment.GetEnvironmentVariables())
{
listBox1.Items.Add(de.Key + ” = ” + de.Value);
}

Do not forget to include this:

using System.Collections; // for DictionaryEntry

VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)

Leave a Comment

Send keystrokes to an application

You can send key stokes virtually to other applications with this:
This code will send F11 key press to Mozilla Firefox, which will make it ‘fullscreen’.

int iHandle = FindWindow(null, “Mozilla Firefox”);
SetForegroundWindow(iHandle);
SendKeys.Send(”{F11}”);

FindWindow and SetForegroundWindow are APIs, which you can access with

[DllImport("user32.dll")]
[...]

Leave a Comment

Restore missing show desktop icon

just execute this in the Start -> Run

regsvr32 /n /i:U shell32

Reference: http://support.microsoft.com/?kbid=190355
VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)

Leave a Comment