using Microsoft.Win32;
//Attempt to open the key.
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Play\WindowPosition");
//The key doesn't exist if it returns null.
if (key == null)
{
//Create & open it.
key = Registry.CurrentUser.CreateSubKey(@"Software\Play\WindowPos");
key.SetValue("PositionX", Location.X);
key.SetValue("PositionY", Location.Y);
}
else
{
//Get value
Location.X = key.GetValue("PositionX");
Location.Y = key.GetValue("PositionY");
}
2009/10/20
[C#]Simple windows registry manipulation
2009/10/19
GetWords
Version: 1.3
Platform: Windows with .Net Framework 2.0 installed
Introduction:
Fetch words from the given article. It will fetch, sort, remove duplicated words. It will ignore the word that less than 3 characters like am, is, as... etc.
How to use:
1.Paste anything you want to parse on the left-hand side textbox.
2.Click the "Get Words!" button, and the result will show on the right-hand side.
2009/10/07
KB: You must call the Bind method before performing this operation.
I got this error message: "You must call the Bind method before performing this operation." when using the UDP protocol to communicate with another application. Here is the simplified code
.......After spending so many hours on this issue, I finally figure out what the problem is.
IPAddress serverIP = IPAddress.Parse("xx.xx.xx.xx");
IPEndPoint serverEP = new IPEndPoint(serverIP, 12345);
UdpClient client = new UdpClient();
//start listening
client.BeginReceive(new AsyncCallback(ReceiveCallback), serverEP); //here causes the problem
//send message to server and wait for response
client.Send(Encoding.UTF8.GetBytes("Hello"), "Hello".Length, serverEP);
.....
[C#][Winform]Show Confirm window
2009/09/17
I Am Busy! 1.0
Version: 1.0
OS: Windows with .Net Framework 2.0 installed.
Introduction:
Want to take a break with an excuse? :)
How to use:
Just click on the "OK" button once you set the title, showing message, total running time and refresh interval (or run it with the default value). You can take a break then.
The program will close automatically after the given time is reached.
Subscribe to:
Posts (Atom)