Jelina
Jelina

Reputation: 1

c# Compilation Error

I'm doing image steganography and visual cryptography project using RSA algorithm. While compiling the project I'm getting these errors:

ArgumentException was unhandled

and also

Empty path name is not legal

This error shown in:

FileStream outStream = 
    new FileStream(stegoFileName, FileMode.Create, FileAccess.Write);

Upvotes: 0

Views: 112

Answers (2)

Abbas
Abbas

Reputation: 14432

Look at this article and certainly the possible exceptions: MSDN: FileStream Constructor. You get the ArgumentException for following possible reasons:

path is an empty string (""), contains only white space, or contains one or more invalid characters.

So make sure the path (the value of 'stegoFileName') is not null, not empty, does not contain invalid characters and refers to a valid path.

Upvotes: 0

Mankarse
Mankarse

Reputation: 40603

You are trying to create and open a file, but you are not specifying a name for the file. This is not possible, so the function complains by throwing an exception.

To fix this, put the name of the file that you want to open into stegoFileName.

Upvotes: 1

Related Questions