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 have used the same delete method without any problems on other FTP servers, but for some reason this server was causing me some issues. I did some searching and didn’t find much except for one comment on an MSDN forum about KeepAlive. This turned out to be the issue and by setting FtpWebRequest.KeepAlive to false fixed the problem 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();
}