I have below code with error. Error message is very simple but I cant get its sense. To me looks like fileStream
is being initalized when it is reading data. Can you please guide what I m missing ?
class Program
{
Stream fileStream=null;
static void Main(string[] args)
{
}
private static void ReadData()
{
using (System.Net.WebResponse tmpRes = ftpReq.GetResponse())
{
fileStream = tmpRes.GetResponseStream();
}
}
EDIT:
I have simplified this code and removed few parts. Error is on fileStream = tmpRes.GetResponseStream();