Thursday, July 2, 2009

Turn off File Readonly Attribute

alway turn it off
fi.Attributes &= ~FileAttributes.ReadOnly;

flip
fi.Attributes ^= FileAttributes.ReadOnly;

Regular Expression CSV Tokeniser Update

see this link for previous blog http://me7486.blogspot.com/2008/06/regular-expression-for-parsing-csv-file_729.html

in addition to previous blogs, if you have situation like "this ""is"" not working",",right". you will need to use the following expression
((?(?=\x22)(?:\x22{1})(?<column>.*?)(?:\x22{1})|(?<column>[^,\r\n]*))(?:[,\r\n]))




Friday, June 12, 2009

Remote Desktop Automatic Logon in Windows XP (User Password Not Required)

micrsoft support link http://support.microsoft.com/kb/281262

This article describes how to turn on Remote Desktop automatic logon. By default, this version of Windows XP is configured to prompt each user to enter a password when connecting through the Remote Desktop client. This behavior holds true even when a correct user name and password are entered in the Remote Desktop Connection box before logon. This article describes how to alter this behavior.


Back to the top
Enable Remote Desktop Logon
To allow automatic logon to a computer running this version of Windows XP through Remote Desktop, follow these steps while logged on as an Administrator:

   1. Click Start, click Run, type MMC, and then press ENTER.
   2. Click File, and then click Add/Remove Snap-in.
   3. Click Add, select Group Policy, click Add, and then click Finish.
   4. Click Close, and then click OK.
   5. Navigate to the following directory:
      Local Computer Policy/Computer Configuration/Administrative Templates/Windows Components/Terminal Services/Encryption and Security
   6. Double-click Always prompt client for password upon connection.
   7. Click the Disabled box, and then click OK. You may now quit the MMC snap-in. Remote Desktop clients should now be able to connect to this Windows XP computer using the automatic logon feature of the Remote Desktop client.

Auto Scrolling C# List Box

source from this article http://www.java2s.com/Code/CSharp/GUI-Windows-Form/SetTopIndextoautoscrollListBox.htm

the key code:

eventLogList.Items.Add(data);

int itemsPerPage = (int)(eventLogList.Height / eventLogList.ItemHeight);

eventLogList.TopIndex = eventLogList.Items.Count - itemsPerPage;

Friday, May 8, 2009

Windows XP Auto Logon

http://www.microsoft.com/windowsxp/using/setup/tips/advanced/autologon.mspx

1. Run (windows run...) "control userpasswords2" and click OK.
2. Clear the Users must enter a user name and password to use this computer check box. Click OK
3. Click the User name box, type the user name that was displayed on the Start menu in step 1. If you normally type a password to log on, type your password in both the Password and Confirm Password boxes. Otherwise, leave these boxes blank. Click OK.

This will allow windows to auto logon with out asking you for password

Thursday, March 12, 2009

How to stop Windows restart after an update

Solution
Windows may need to be restarted after an update has occurred, in order to allow files that are in use to be replaced. If you would prefer to restart the computer at your convenience, and not be nagged to do so, try one of the following solutions:

Method 1
Click Start, Run and enter the command net stop wuauserv
This will stop the Windows Update service until the next restart of the computer, which will stop the reminders to restart your computer for this update.

Method 2
If you are running Windows XP Professional, the following steps will increase the period between restart reminders to the maximum possible.

Click Start, Run and enter the command gpedit.msc
Select Local Computer Policy, Computer Configuration, Administrative Templates, Windows Components, Windows Update
Double-click Re-prompt for restart with scheduled installations
Change the value to 1440
Close the Group Policy Editor
Click Start, Run and enter the command gpupdate /force
This will stop the repeated reminders for this and all future Windows updates.


Here's how to prevent Automatic Update from rebooting your machine:

Start -> Run
Type: gpedit.msc
Expand Local Computer Policy / Computer Configuration / Administrative Templates / Windows Components / Windows Update
Double-click "No auto-restart for scheduled Automatic Updates installations"
Select "Enabled", then OK. Close the Group Policy configuration program.


Sunday, February 15, 2009

RUN .NET Windows Application (.exe) in OSX

Install Mono http://www.mono-project.com/Main_Page

To run .NET Application Assembly exe

browse the directory contain the application and type
   
     mono YourApplication.exe

Apple Script
do shell script "mono /Users/YOU/Downloads/YourApplication.exe"