2007-03-05 22:49:18

Error using FtpWebRequest.


If you recieve the following error when using the FtpWebRequest class in .NET 2.0:

The remote server returned an error: (500) Syntax error, command unrecognized.

This might be because you used two or more requests and supplied credentials for one and not the other. I encountered this problem and solved it by always suppling credentials, as follows:

request.Credentials = new NetworkCredential("anonymous", "janeDoe@contoso.com");






2006-08-01 23:52:33
A solution I found for running Yahoo Music Engine under a limited user account.

Problem:
Yahoo Music Engine won't run under a limited account.

Solution:
1) Start | Run
2) Type regedit and click ok
3) Navigate to : HKEY_LOCAL_MACHINE | SOFTWARE | YAHOO | YMP
4) Right Click Preferences and select Permissions
5) Highlight Users in the top box and checkmark Full Control under Allow

Hope this helps someone.









2006-12-07 00:06:58

Providing a Save As Dialog for an image in ASP.NET.



I was in need of a way to trick browsers into providing a save dialog for saving images. By default, browsers display images within the browser window. While this seems fine and dandy, believe it or not, there are a lot of people who still don't understand how to save pictures from browsers, so I wanted to make it extremely easy.

You can use the following code in ASP.NET to do exactly this.

Response.Clear();
Response.ContentType = "image/gif";
Response.AddHeader("Content-Disposition", "attachment; filename=pictures.jpg");
Response.WriteFile("~/images/image.jpg");
Response.Flush();
Response.Close();