Hi,
how can i make this to write in log when is start and when is end time of request ? I use this but i want to know also time when is end every request ?
Now write only start time
Code:
WebResponse response = webRequest.GetResponse();
Stream dataStreamResponse = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStreamResponse);
string responseFromServer = reader.ReadToEnd();
Console.WriteLine(responseFromServer); //<----
reader.Close();
dataStreamResponse.Close();
response.Close();

StreamWriter log;
if (!File.Exists("\\log.txt"))
{
   log = new StreamWriter("\\log.txt");
}
else
{
   log = File.AppendText("\\log.txt");
}
log.WriteLine(DateTime.Now);
log.WriteLine(responseFromServer);
log.WriteLine();
log.Close();