MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
Public arrSettings(100) As String 'The Program Files folder, and all sub folders, are read only to standard users. This is by design. Instead, use the application data folder: 'My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData 'or 'My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData Sub WriteText() Dim oPath As String = My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData & "\EI" 'Environ("userprofile") & "\EI" 'Dim oPath As String = "C:\Program Files\EI" If Not Directory.Exists(oPath) Then Directory.CreateDirectory(oPath) End If File.WriteAllLines(oPath & "/Settings.txt", arrSettings) End Sub Sub ReadText() Dim oPath As String = My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData & "\EI" 'Environ("userprofile") & "\EI" If Not Directory.Exists(oPath) Then 'Directory.CreateDirectory(oPath) Exit Sub End If ' Create StreamReader for the file. 'Using reader As StreamReader = New StreamReader("file.txt") Using reader As StreamReader = New StreamReader(oPath) ' Do While true loop. Do While (True) ' Read a line. Dim line As String = reader.ReadLine ' See if line is Nothing. If line Is Nothing Then Exit Do End If ' Write line to screen. 'Console.WriteLine(line) Loop End Using End Sub
|xcopy commands not running in batch file if user is logged out||5||24|
|VB net, code to modify xlsx file, and errors when it is ran on NON-developer PC...||2||22|
|start a process from a service||3||21|
|Windows 7 Professional||6||53|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
13 Experts available now in Live!