Solved

VB.net Write Text File to hiiden folder

Posted on 2016-09-15
3
46 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 80

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…

820 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