Pues te recomiendo que uses system.io
Para crear un archivo si no existe...
Código vb:
Ver originalIf Not System.IO.File.Exists("C:\archivo.txt") Then
System.IO.File.CreateText("C:\archivo.txt").Close()
End If
Pero tienes que tener en cuenta que no necesitas "crearlo" para escribir.. hay una funciona
AppendAllText está función sirve para agregar texto a un documento, de no existir lo crea automáticamente y agrega el texto, hay que tener cuidado, ya que el texto lo agrega, hay que comprobar que no exista porque podría escribir 2 veces lo mismo...
Código vb:
Ver originalIf Not System.IO.File.Exists("C:\archivo.txt") Then
System.IO.File.AppendAllText("C:\archivo.txt", "Usuario" & vbCrLf & "Contraseña")
End If