Posted by Mike
on March 05, 2008
I learned about a product today that has completely made my day.
ViEmu It’s a Vi emulation add-in for Visual Studio. Having come to Windows programming from Unix and Linux, I’ve been a long time user of Vi and Vim. One of the difficult things about Visual Studio for me is having to take my hands off of the keyboard to do certain things. In the little bit of time that I’ve been using ViEmu, I feel so much more comfortable. It’s amazing to me how something as simple as this gives such an increased feeling of power and speed in Visual Studio. Ah, what a beautiful day.
Posted by Mike
on March 03, 2008
This error came up today using FtpWebRequest in .Net. I had used the same delete method without any problems in the past, but for some reason the FTP server that I was working with was having an issue. I spent some time searching before finding one comment on an MSDN forum about KeepAlive. This turned out to be the answer. By setting FtpWebRequest.KeepAlive to false the problem was fixed and I haven’t seen it since.
private void Delete(string remoteFile) {
string deleteRequest = ftpServer + remoteFile;
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(deleteRequest);
request.Method = WebRequestMethods.Ftp.DeleteFile;
request.Credentials = new NetworkCredential(ftpLoginName, ftpLoginPassword);
request.Proxy = null;
request.UseBinary = false;
request.UsePassive = true;
request.KeepAlive = false;
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
StreamReader sr = new StreamReader(responseStream);
sr.ReadToEnd();
string StatusCode = response.StatusDescription;
sr.Close();
response.Close();
}