Solved

VB.net Write Text File to hiiden folder

Posted on 2016-09-15
3
35 Views
Last Modified: 2016-09-15
Hi

In VB.net I want to write a text file to a folder that the user can't see. So far I know of the Application data folder (specified in code below) that can be accessed by a user, but is there something more hidden? I don't want to use Settings as this get wiped out from time to time for some unknown reason.
Dim oAppData_Folder As String = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
0
Comment
Question by:murbro
3 Comments
 
LVL 33

Expert Comment

by:it_saige
ID: 41800177
Perhaps use IsolatedStorage?

-saige-
0
 
LVL 79

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 41800252
You should be using the .net routines specific for this
Dim localSettings As Windows.Storage.ApplicationDataContainer = Windows.Storage.ApplicationData.Current.LocalSettings
Dim localFolder As Windows.Storage.StorageFolder = Windows.Storage.ApplicationData.Current.LocalFolder

Open in new window

Dim container As Windows.Storage.ApplicationDataContainer = 
   localSettings.CreateContainer("exampleContainer", Windows.Storage.ApplicationDataCreateDisposition.Always)

If localSettings.Containers.ContainsKey("exampleContainer") Then
    localSettings.Containers("exampleContainer").Values("exampleSetting") = "Hello Windows"
End If

Open in new window

More examples and source
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh700361.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1
0
 

Author Closing Comment

by:murbro
ID: 41800272
Thanks very much
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Change data in datatable 8 31
Saveas need to save a copy 16 26
update textboxes with Streamreader 21 42
Help with AsEnumerable(), LINQ 4 22
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now