How to change the path of user.config winforms - vb.net

There are settings I just want to change from the program, I don't want the file to be changed
So I want to change the file path or try to hide it
Is there a way?

Make them user scoped and then don't save the settings (or set them back to their defaults before you save the settings)
User Scoped settings are stored in a hidden file/folder under the user profile folder anyway. Only Application Scoped settings live in the YourAppName.config file alongside the EXE. Aplication Scoped settings cannot be changed at runtime
See also Why are application settings read-only in app.config?

Related

Unable to list folders when using scoped app permission for Dropbox

I'm able to successfully list folder and contents when my dropbox developer app has full access, however, when I'm using scoped access only to a specific folder, it fails.
Now when I switch to scoped access to a specific folder I'm running into errors. This request should fail since the app does not have access to the folder.
Now when I put in the right folder path, I'm still getting the same error.
For reference I'm sharing my app details
It looks like you're using the App Folder permission. This will root all your paths relative to that app folder; your app will not be able to see outside of it.
For example, if the user sees the file as "/Apps/AppFolderAccess/myfile.txt", your app will see it as "/myfile.txt". By setting your path to /Apps/AppFolderAccess, it is effectively resolving as /Apps/AppFolderAccess/Apps/AppFolderAccess - which is not found.
If your application needs to see content outside its app folder, you should select full access.
Building on top of the other answer: you need to set the application permission to access type "Full Dropbox– Access to all files and folders in a user's Dropbox."
However, note that this requires you to delete your existing app and create a new one since it is not possible to change the scope of an existing app.

How to access previous app state/config on app relaunch (TornadoFx)

After looking at state/settings, configuration, I have tried config and app.config for app state/setting management. When I use app.config, I am able to access the state in other views.
I wish to implement state such that when the app is launched a second time, the first view or behavior should be different based on the state config/settings of the previous session.
I realized that each time I relaunch the app all states default to null.
I even came across the notion of configBasedPath and configPath but what I am not sure about is,
if my app is to create them automatically or I need to do it manually
If my app will automatically resolve the config path to app.properties or I will need to do it manually.
This is because after running my app, I do not see the default conf base directory and the app.properties file.
I am currently developing on windows 10 and use FXLauncher for packaging.
How can I persist state in my app such that I can always access the previous states/settings I run the app?
To persist configuration changes, simply call save() on the config object. To save the global app config settings, call app.config.save(). Changes are automatically loaded when the app starts.
You can read more about the config object in the guide:
https://github.com/edvin/tornadofx-guide/blob/master/part2/Config%20Settings%20and%20State.md

open shared folder to specific user

Let's say that I have created a share folder to specific user I want to test it and don't know how.
I mean I know I can right click on the folder and view the properties, but I want to "test it on live".
I tried window+R to open "Run" and then entered \\10.1.1.10 and it showed me the shared folder but I can't open it.
my question: how to open it with the user that specific user that binded to this folder?
Login to windows with the new user that you created, and then check if you have access to the folder via UNC

manage and configure windows services with an own control panel

I have written some windows services. Each service has some settings that I currently store in a .ini file.
I would like to manage the services now in a control panel and would like to be able to manage the settings there in a collective manner.
Are the respective app.config files the right choice?
or should i store the settings (like timer Intervall, etc.) in the registry?
If not
How to Access the app.config files?
I have tried something like that
Dim fileMap As ConfigurationFileMap =
New ConfigurationFileMap("myService.exe.config")
Dim configuration =
ConfigurationManager.OpenMappedMachineConfiguration(fileMap)
But the AppSettings are Nothing
or am I on the wrong track?
I hope somebody has a great idea
how to manage and configure windows services with an own control panel?
First of all: With the ServiceController Class you can control every Serivce (Start, Stop, Restart, and so on). You should check out the example at the MSDN page if you want to know how it works.
How you save your settings is your own choice. You could use the .config file, a .ini file or just the registry. Just choose the option which works better for you.
Since your services already use a .ini as a config file you could just access and edit these files with your control panel. I guess the .ini files are saved in the same folder where the service.exe is located. So you can use AppDomain.CurrentDomain.BaseDirectory to find out where the service is located on the machine and start editing it. For your control panel you can also use a .ini config file our just play around with My.Settings
Hope this brings you on the right track!

DotNetNuke Secure Module Folder

I have created a module in DNN which has a sub-folder that contains several files which are used by the module, but which I do not want accessible by the public. Being new to DNN I had originally thought to simply add a Web.config and set deny users="*" in the authorization section. It looks to me now though that DNN intercepts all the requests and ignores the Web.config as this setting seems to have no effect.
Users can currently access these files simply by guessing a file name and navigating to (http://mysite.com/DesktopModules/mymodule/restricted_files/guessedfile.pdf). How can I prevent this from happening?
DotNetNuke allows you to have different providers for folders in the file system. If you use those providers (instead of interacting with the file system directly), then you can make sure that DNN has control of the permission to the files in the folder.
Built into DNN are three providers, Standard, Secure, and Database. If you create a folder with the Secure or Database provider, then DNN will make sure that you can't get to the file just by guessing the path (either by appending .resources to the filename, which IIS won't serve, or by putting it in the database). You can then assign permissions to the folder (via the File Manager page in the Admin menu) to indicate who can get to those files (the site administrator will always be able to access the files, unless you're using the Host file system).
However, these folder providers only apply to the Portals directory in the site. It's recommended that you'd store content files there, rather than in DesktopModules.