Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm trying to save files. They save OK the first time, i.e. when they're created, but I can't successfully save the changes. Here's the code I'm using:

 

Dim TestFileStream As Stream

       TestFileStream = File.Open(FullPath, FileMode.Create, FileAccess.Write)

       Dim serializer As New BinaryFormatter
       serializer.Serialize(TestFileStream, Me.SerializationCol)
       TestFileStream.Close()

 

In relation to FileAccess.Write the helpfile says:

 

"Specifies that the operating system should create a new file. If the file already exists, it will be overwritten. This requires FileIOPermissionAccess.Write. System.IO.FileMode.Create is equivalent to requesting that if the file does not exist, use CreateNew; otherwise, use Truncate. ", but the link for FileIOPermissionAccess.Write is broken.

 

How do I get my files to save properly?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...