I have created a new file using the code below. But if the file already exists then I need to create a new file with another file name. Is this possible?
FileStream fs = new FileStream(filePath, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(b);
bw.Close();
fs.Dispose();
my file save location is same.
Sure, you can use
File.Exists(filePath)to checck if the fie already exists and choose another name in that case.