Are you closing your StreamWriter? I don't see sw.Close(). This is necessary to flush the buffer to disk.
Minimally, the objWebResp should be closed as well. The objWebResp is rather important because by default your application can only open two simultaneous connections to another machine (configuration/system.net/connectionManagement in the app.config file). I'd recommend the "using" keyword to ensure proper cleanup even if an exception occurs.
|
| using(HttpWebResponseobjWebResp=(HttpWebResponse)objWebReq.GetResponse()) |
| { |
| //Codehere. |
| } |
|