hi
I am getting this exception.
I wrote code to save multiple Images...now when I save all the 4 images I get no exception...
but when I try to save only 1 or 2 or 3 its throws an exception "Empty Path is not legal".
Little help plz.
hi
I am getting this exception.
I wrote code to save multiple Images...now when I save all the 4 images I get no exception...
but when I try to save only 1 or 2 or 3 its throws an exception "Empty Path is not legal".
Little help plz.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shefali LahariyaPosted Dec 22, 2017, 2:36 AM
Ashu PardeshiPosted Aug 19, 2015, 6:32 AM
suman kumarPosted Nov 27, 2013, 4:13 AM
and Now its working...:)
string picLoc = @"d:\Pc Configure\Pc Configure\Resources\stopgate1.png";
Girish SapariyaPosted Nov 27, 2013, 12:28 AM
before reading file,
i.e
FileStream fs = new FileStream(picLoc, FileMode.Open, FileAccess.Read);
i.e
if(picLoc != null && picLoc != "")
{
FileStream fs = new FileStream(picLoc, FileMode.Open, FileAccess.Read);
}
check whether the path is not null And not empty
If path null And empty, then dont read the file.
same for other image path also.
try it, and let us know
suman kumarPosted Nov 27, 2013, 12:18 AM
I just gave path to my string and now its working fine thanks :)
suman kumarPosted Nov 26, 2013, 7:32 AM
string picloc;
Now I a,m getting
Path cannot be null.
Parameter name: path
which is still wrong and I just got slapped(:d) for it
but Let me try it one more time I think I understand it now....
I will get back to you.
thanks:)
Girish SapariyaPosted Nov 26, 2013, 1:11 AM
when you try to save 1 or 2 or 3 images it throws exception because,
filestream requires the path of the file and it should not be blank or null.
**Syntax****FileStream(string path, FileMode mode, FileAccess access);*****
In your case, when you dont save anyone or more image, the path is set to blank
i.e
either your picLoc or picLoc1 or picLoc2 or picLoc3 is blank
check for empty string or null string in your code and save accordingly
suman kumarPosted Nov 25, 2013, 8:32 AM
here is the code...
Jaganathan BantheswaranPosted Nov 25, 2013, 8:29 AM