Microsoft .NET Framework 4.x Redistributable Installer Link

Sometimes, it’s hard to find Microsoft .Net framework 4.x installer link.

Here is my collections for the link:

 

.NET Framework version Redistributable installation
4.6 Preview Download page for 4.6 web installer
Download page for 4.6 offline installer
4.5.2 Download page for 4.5.2 web installer
Download page for 4.5.2 offline installer
4.5.1 Download page for 4.5.1 web installer
Download page for 4.5.1 offline installer
4.5 Download page for 4.5 web installer
Download page for 4.5 offline installer
4 Download page for 4 web installer
Download page for 4 offline installer
4 Client Profile Download page for 4 Client Profile web installer
Download page for 4 Client Profile offline installer

 

Download a hotfix without contacting Microsoft?

I am working on Windows 7 Embedded recently, and need some hotfix, which is not publicly released by Microsoft. I found this article very useful.

How can you download a hotfix without contacting Microsoft?

Here is the tricks:

A customer can get the fix they want without calling in to Microsoft, assuming they know the KB number of the hotfix they want and can remember the URL format for a self-service hotfix request:

http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=KBNumber&kbln=KBLanguage

 

My first x64 assembly code cooked by hand

This is my first hand made x64 assembly code.

extrn MessageBoxA:proc

.DATA
CONST SEGMENT
    msg DB "Hello World!", 0
CONST ENDS

.CODE
main PROC
    sub rsp, 28h
    xor rcx, rcx
    lea rdx, msg
    lea r8, msg
    xor r9, r9
    call MessageBoxA
main ENDP
END

To compile this code, in command prompt run

ml64 helloworld.asm /link /subsystem:windows /defaultlib:user32.lib /entry:main

The major different between x86 and x64 calling conventions. The first six integer or pointer arguments are passed in registers RDI, RSI, RDX, RCX, R8, and R9, while XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6 and XMM7 are used for floating point arguments. additional arguments are passed on the stack and the return value is stored in RAX.

Sydney Badminton Courts

  1. Olympic Park Sports Hall
    Address: Australia Ave, Sydney Olympic Park, Sydney
  2. FIVE DOCK LEISURE CENTRE
    Address: CNR Queens Rd and William St, Five Dock, NSW, 2046
  3. Lidcombe Netball Centre
    Address: Church St, Lidcombe
  4. Castle Hill RSL
    Address: Castle Hill High School’s Gymnasium
  5. Hurstville Boys High School
  6. Macquarie Uni
  7. Sydney University
  8. Hornsby PCYC
  9. Epping Boys High School
  10. Concord High School
  11. Dulwich High School‎
    Address: Seaview Street Dulwich Hill NSW 2203
  12. Baulkham Hill High School
  13. Ashfield Boys High School
    Address: 115 Liverpool Road, Ashfield
  14. Taren PointYouth Centre
    Address 135 Taren Point Road, TarenPoint NSW 2229
  15. North Ryde RSL
  16. UNSW Gym
  17. Ryde aquatic leisure centre
  18. Epping YMCA
  19. Mascot JJ cahill Memorial High school
  20. Brickpit Sport Stadium, Thornleigh
  21. Robyn Webster Sports Centre
    Address: Tempe Recreation Reserve Holbeach Avenue Tempe
  22. National Badminton Centre
    Address: Unit 2B 172 Silverwater Rd Silverwater
  23. Waterloo
    Address: 18 O’Dea Avenue Waterloo NSW 2017
  24. Marella Avenue Kellyville NSW 2155
  25. Lindfield UTS Kuring-Gai campus
  26. Macquarie Fields Leisure Centre
    Address: 52 Fields Rd, Macquarie Fields New South Wales 2564
  27. VICTOR Badminton Centre
    Address: Unit 4, 35 Carter Street, Sydney Olympic Park NSW 2127
  28. Ryde Community Sports Centre
    Address: ELS Hall Park Kent Road, North Ryde 2113

Resize photo in C#

Today, my friend asked me to recommend a free resize photo tool, and he got lots of photos. I really don’t know. Normally I use MS Paint and select Stretch and Skew. If here are many photos, it would take ages. I then wrote a small tool for him using C#. The code is fairly simple cause .Net Framework provides huge library to use.

private void ResizePhoto()
{
	//find all jpg photos in given folder
	string[] jpgFiles = Directory.GetFiles(photoPath,"*.jpg");
	foreach(string file in jpgFiles)
	{
		//load orignial photo into memory
		Image image = Image.FromFile(file);
		//create new photo using new size from original photo
		Image newImage = new Bitmap(image,new Size(newWidth,newHeight));
		//give a new file name
		string newFileName = "newsize" + file;
		//save new photo
		newImage.Save(newFileName,System.Drawing.Imaging.ImageFormat.Jpeg);
		newImage.Dispose();
		image.Dispose();
	}
}

 

Add watermark in your photo using C#

Some of my photos need to be added watermark to prevent abusing. I just found a easy way to add watermark into your photo using C#. Here is the code to share.

private void button1_Click(object sender, System.EventArgs e)
{
	OpenFileDialog of = new OpenFileDialog();
	of.Filter = "Image Files (*.bmp;*.emf;*.exif;*.gif;*.jpg;*.png;*.tif;*.wmf)|*.bmp;*.emf;*.exif;*.gif;*.jpg;*.png;*.tif;*.wmf";

	if(of.ShowDialog(this) == DialogResult.OK)
	{
		Image image = Image.FromFile(of.FileName);
		Graphics g = Graphics.FromImage(image);

		// Create a solid brush to write the watermark text on the image
		Brush myBrush = new SolidBrush(Color.Black);
		Font myFont = this.Font;
		// Calculate the size of the text
		SizeF sz = g.MeasureString("https://www.nickdu.com", myFont);

		// drawing position (X,Y)
		float X =(image.Width - sz.Width)/2f;
		float Y = image.Height/2f;

		g.DrawString("https://www.nickdu.com",myFont,myBrush,X,Y);
		SaveFileDialog sf = new SaveFileDialog();
		sf.Filter = of.Filter;
		if(sf.ShowDialog(this) == DialogResult.OK)
		{
			image.Save(sf.FileName);
		}
		image.Dispose();
	}
}

This is the sample

watermark sample
watermark sample