Some notes on software development... RSS 2.0
# Friday, 14 March 2008

With the full .NET library you can call Application.ProductVersion to get the version number of your running application.
This method is not available for Compact Framework so we have to use reflection to help us interrogate the running assembly.

The info we need is held in the AssemblyName class and which we can populate by calling GetExecutingAssembly static method from the Assembly class in the System.Reflection namespace.
The code:

AssemblyName currentAssemblyName = Assembly.GetExecutingAssembly().GetName();
string version = currentAssemblyName.Version.ToString();
 
Friday, 14 March 2008 11:54:42 (GMT Standard Time, UTC+00:00)  #    -
CF
# Monday, 10 March 2008

Using P/Invoke you can play a beep through the PC speaker.

The P/Invoke prototype:

[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool Beep(uint dwFreq, uint dwDuration);
Parameters:
dwFreq
specifies the frequency, in hertz, of the sound. This parameter must be in the range 37 through 32,767 (0x25 through 0x7FFF).
dwDuration specifies the duration, in milliseconds, of the sound.
Example code to call the function:
Beep(500, 1000);
Warning!!! Beep is NOT asynchronous so it does not return to the caller until the beep has finished
Links:
PInvoke.net Beep (Kernel32) reference


Monday, 10 March 2008 17:25:20 (GMT Standard Time, UTC+00:00)  #    -
C#
# Saturday, 08 March 2008

Searching for an email link obfuscation tool I came across this handy tool from the University of Nebraska !?

Spam-me-not E-mail Link Obfuscator

You can choose different encryption modes like decimal, hexadecimal and random-mixed notation.

Saturday, 08 March 2008 20:24:32 (GMT Standard Time, UTC+00:00)  #    -
Web Dev

If you run any P2P or torrent software with Windows XP SP2 you may run in to some network performance issues. This is due to Microsoft reducing the number of half-open concurrent connections from 65,000 to 10 as part of SP2.
When the limit of 10 is reached any further connections are queued up and released by Windows at a rate of 10 per second.

This limit was introduced to reduce the speed at which viruses and worms etc using PC's can spread themselves. However the side effect means some networking applications struggle to function as intended.

Checking the Windows System Event Log will show a warning for Event ID 4226:

image

The Fix:
A patcher exists at www.lvllord.de
Download and run the file EvID4226Patch.exe
It will detect the version of TCPIP.SYS and tell you the current limit for concurrent half-open connections.
Pressing Y to install the patch will change the limit to 50.
You also have the option to change the limit to any value between 10 and 16777214.

After a restart the new limit will take effect.

Job done.

Links
EventID 4226 Patcher from LvlLord
Speedguide.net article

Saturday, 08 March 2008 09:48:39 (GMT Standard Time, UTC+00:00)  #    -
Windows
Navigation

Sign In
Extras
Statistics
Total Posts: 116
This Year: 0
This Month: 0
This Week: 0
Comments: 36
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2018
Hadrian Phillips

All Content © 2018, Hadrian Phillips
DasBlog theme 'Business' created by Christoph De Baene (delarou)