Friday, March 11, 2011

To Resize the image

To resize the image without croping and distorting it. Follow these steps for it:

System.Drawing.Bitmap OriginalBM = new System.Drawing.Bitmap(Server.MapPath("./SiteImages/FoodItems" + "/" + postingImage));
System.Drawing.Size newSize = new System.Drawing.Size(90, 90);
System.Drawing.Bitmap ResizedBM = new System.Drawing.Bitmap(OriginalBM, newSize);
ResizedBM.Save(Server.MapPath("./SiteImages/NewImages/" + postingImage));

Wednesday, March 9, 2011

To run apache along with IIS

Apache and IIS will not work simultaneously, because both are using port80.

To run apache along with iis7 on same machine, first you need to stop iis7.
But still port 80 will not get free because is used sqlserver reporting server.
And it will show the following error on checking the port 80:
Microsoft-httpapi 2.0 is running.

This is due to microsoft sqlserver's reporting server.
So stop its service first then use port 80 for wamp. It will work.
OR

Follow these steps to change wamps port no.
1. Open your WAMP installation directory
2. Navigate to the conf directory
3. Open your httpd.conf file
4. Search for "Port 80"
5. Change the port to something like "8080"
6. Restart apache