Hello, I am trying to write some VB code to open a text file (located on the SharePoint Server) when the form is opened as new, read the text (which would carry my autonumbers), place the text into a field on the form, write back to the file with a new number, and then close the file. The problem that I am having is the last time that I wrote this routine, I got an error stating "SecurityException was unhandled by user", is there a work around to this issue? I have provided the code below without true locations. Any help would be appreciated.
Dim fileContents As String, a As Integer, b As IntegerfileContents = My.Computer.FileSystem.ReadAllText("\\weblocation\Database\Test1.txt")
b = Convert.ToInt32(fileContents)
a = b + 1
My.Computer.FileSystem.WriteAllText("\\weblocation\Database\Test1.txt", a, True)