Monday, December 7, 2009

Check Open Port (Windows XP)

If you need to find out what ports are opened, established and closed, use these commands in the command prompt.
type: netstat -a or this one: netstat -an, this shows the list ports that you use in your computer.

type : netstat -an |find /i "listening" and netstat -an | find /i "established", to know who is listening or established.

type : netstat -an |find /i "listening" > c:\openports.txt, to save the ports list to a text file.

To get a list of all the open, established, closing and other used ports: netstat -ao

Please see the list of common Trojan port numbers from http://www.sans.org/resources/idfaq/oddports.php

Monday, August 10, 2009

Register a DLL into GAC (Strong Named)

A strong name consists of the assembly's identity, it's simple text name, version number, and culture information (if provided), plus a public key and a digital signature. These are the following steps before you can place a dll into the GAC :

1. Generate the public key:
Use visualStudio.Net command prompt and type the following command:

sn -k keyfile1.snk
keyfile1.snk is the keyfile we are generating.

Store this key file in the bin folder of the assembly. For example:
C:\foldername\assemblyname\bin sn-k keyfile1.snk

2. Placing the keyfile into the Assembly.
Go to AssemblyInfo.vb/AssemblyInfo.cs file:
[Assembly: AssemblyKeyFile("C:\\foldername\\assemblyname\\keyfile1.snk")]

3. ReBuild the Assembly.

4. Placing the assembly into GAC

There are two ways to place the assembly into GAC.
1. Using the utility gacutil -i
Here you should give the complete path of the dll

c:\>gactutil -i c:\foldername\assemblyname\bin\assemblyname.dll

2. The second method is u can drag the .dll file from the bin folder of the assembly and drop it into GAC.
GAC is located Usually at C:\winnt\assembly or C:\windows\assembly.

Sunday, April 5, 2009

lock

Menyembunyikan/mengunci folder di komputer menggunakan NOTEPAD.

@ECHO OFF
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
ARE YOU SURE WANT TO LOCK FOLDER ??(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder Terkunci
goto End
:UNLOCK
PLEASE INSERT PASSWORD!
set/p "pass=>"
if NOT %pass%== password goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid Password
goto end
:MDLOCKER
md Locker
echo Folder Created successfully
goto End
:End

Tulisan "password" adalah password untuk membuka folder, bisa diganti dengan password yang lainnya. Setiap perubahan Save as type dengan All Files dan kasih extensinya *.bat kemudian save

Click file *.bat tulis password yang dimasukkan tadi kemudian tekan ENTER.
Setelah itu nanti ada sebuah folder dengan nama Locker, simpan file-file disitu .
Click lagi file *.bat dan ketik y kemudian enter untuk mengunci dan menyembunyikan Folder.

Check flash disk data before format

  • Type in command prompt (cmd), attrib -s -h f:*.* /s /d
  • f is drive that you want to checked.

Thursday, February 19, 2009

Create Outlook appointment or meeting request using C#.NET

Create an appointment or meeting request using C#. You need the Microsoft Office framework.

using Microsoft.Office.Interop.Outlook;

public static void CreateMeetingRequest(string to, string subject, string body, DateTime startDate , DateTime endDate)
{
Microsoft.Office.Interop.Outlook.Application objOL = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.AppointmentItem objAppt = (Microsoft.Office.Interop.Outlook.AppointmentItem)objOL.CreateItem(OlItemType.olAppointmentItem);
objAppt.Start = startDate;
objAppt.End = endDate;
objAppt.Subject = subject;
objAppt.Body = body;
objAppt.MeetingStatus = Microsoft.Office.Interop.Outlook.OlMeetingStatus.olMeeting;
objAppt.RequiredAttendees = to;
objAppt.Send();
objAppt = null;
objOL = null;
}

private void button1_Click(object sender, System.EventArgs e)
{
CreateMeetingRequest("xxx@xxx.com", "test", "try email", Convert.ToDateTime("02/19/2009 11:55"), Convert.ToDateTime("02/20/2009 11:55"));
}

http://www.systemnetmail.com/

http://www.officewiki.org/default.aspx/Outlook.AppointmentItem

http://www.outlookcode.com/d/index.htm

Advanced calendaring with Exchange 2000

http://msdn2.microsoft.com/en-us/library/ms991812.aspx

Thursday, January 15, 2009

Make Form Auto Opacity

To create form fade out or fade in, you can change the value of opacity property by repetition. (Increase or decrease value by 0.1)

using System.Threading;

private void Form1_MouseHover(object sender, EventArgs e)
{
Point ptCursor = Cursor.Position;
ptCursor = PointToClient(ptCursor);
if (this.ClientRectangle.Contains(ptCursor))
{
i = this.Opacity;
while (i <= 1)
{
i += 0.1;
this.Opacity = i;
Thread.Sleep(30);
}
}
}