I have a custom settings class which I use for Machine Wide Application Settings and save as a file. I use a custom file instead of the visual studio settings config because Int the settings to be machine scope or application scope which are normally unusable as they are readonly.I dont want the settings to be user scoped.
Imports System.Xml.Serialization
Namespace My
Public NotInheritable Class MySystemSettings
I would like to be able to specify exactly where the My.Settings file gets saved. It bugs me how it gets saved off in the middle of appsettings nowhere, and I would prefer it gets saved where the executable is. If anyone knows how to do this, that would be great. (P.S; I'm using VB.Net.)
I'm wanting to allow "Email notifications" from my application, where by the user would supply their gmail username, password and a "to" address to send the notifications to. I am storing these as application settings, but obviously they'll be unencrypted in the config file.
I thought about just requiring them to type in their password each time they run the application, that way nothing is stored, but this isn't user-friendly. Is there a different way to send email from the application, much like other apps do where there's a "submit a problem" type functionality?
I have used System.Security.Cryptography classes to encrypt and decrypt connection settings but have a question regarding securing the private key needed to decrypt. Given that assemblies can be easily read, what is the preferred method for storing the private key so that it is not visible to anyone who goes looking?
1. I can't find the file which reflects changes to user settings. This might be because I just can't find it (I can see a bunch of user.config files but they are all empty - weird!), or...
2. I'm not actually saving them when I think I am.
Regarding 2. - do I need to invoke
Is this all I need? And if so, why are my user.configs empty?
I have created a settings-file for my plug-in-based app. When the mainApp writes the settings to the file, the pluginApp should read the settings from the settings-file (when opening or at runtime even better), but somehow it reads the settings from the app.config-file. This means that the pluginApp never will read the settings according the values of the file.
I have a Visual Basic .Net 2.0 program. I'm moving the settings from an older settings file, to an app.config program settings file. I'm trying to do this as nicely as possible.
So, I added my setting as shown in this image.
On load I do this:
If My.Settings.databaseConnectionSettings Is Nothing Then My.Settings.databaseConnectionSettings = New ArrayList() End If
[Code]....
So, the question is, how do I get that arraylist of my DatabaseConnectionSettings saved to persistent storage? I want to do this in the cleanest way possible. That is, I don't want to have to convert it to a string or save it to a separate file every-time I want to use it. I would like to be able to use the My.Settings accessor method.
I want to save a Custom DateTimePicker.Value in my Application Settings. The custom format is : dd/MM/yyyy hh:mm:ss, instead of dd/MM/yyyy The field i've created in the application settings parameters is LASTSAVE (DATE / APPLICATION)
When I try to link in the ApplicationSettings/PropertyBinding ... VALUE with my field LASTSAVE, i have an error :
The Value '01/01/0001 00:00:00' is not valid for 'Value'. 'Value' mustbe ... 'MinDate' et 'MaxDate'.
Name of the parameter : Value
I then entered the MIN and MAX date in the properties of my control DATETIMEPICKER. I have also put into the properties Value a start date like 23/11/2011 12:00:00 ;
However, when i retry to link in the ApplicationSettings/PropertyBinding ... value to LASTSAVE / I have the same error (The Value '01/01/0001 00:00:00' is not valid for 'Value'. ). I've saved all, do a process that put a value in the datetimepicker.value, but it's not saved, cause not linked.
In Visual Studio 2005 or 2008, when adding any User Controls to a Windows Form or other User Control in a Project that implements and is using a custom settings provider, a "Failed to create component" error is displayed. If all references to the custom settings provider are removed from settings.settings and that file is saved then User Controls can be added to Windows Forms and User Controls. However, if the custom settings provider is referenced again in settings.settings, then opening the designer of a Form/Control which includes a User Control results in a "One or more errors encountered while loading the designer..." error message.
I have had a very difficult time in tracking down the root cause of this issue because I assumed it had to do with my code and not the IDE. I am working within the context of a large project which uses User Controls heavily and have written a custom settings provider to persist user settings to a SQL Express database. This settings provider works properly, however if I want to open any Forms or User Controls in designer view I must first manually remove all references to my custom settings provider in setting.settings and then re-add them after the changes are done which is inconvenient to say the least. This problem is not present if the Project is in C#.
(using VB.Net 2008) I am trying to save one of my custom types to the application settings. I've read a variety of opinions on the internet about whether this possible.
When creating an app setting, none of my types appear when browsing. However, previously I needed to save off one of my datasets, and it worked simply by hand-entering it as the setting type (ie, I just typed "MyProjectName.DatasetName"). However, when I try the same trick with another custom type that isn't a dataset, I get a "type was not found" error. So I'm a little confused, can the program "find" some custom types and not others?
I was just wondering what is the Quickest way to set up custom settings, every software has settings that are created and saved, Example a Hotel Software has rooms, roomtypes etc that are used in combination with other things, an Accounting software has Account type, Employee Software will have Full time,Parttime, or anything else, An Employee time Clock would have departments, Tax Brackets.
This has been driving me batty for the last while. I have an application that is passing up data to a SQL server table. Part of the data is dates. Because of settings on the SQL server the update will not accept the MM/dd/yyyy format. I have been trying for quite some time to get around this.
For some more information. Changing the update method or the server regional settings is not an option and I don't want to change my regional settings as this may not reflect the production server when this goes live.
Here is what I have tried so far
Code: Dim dateEnd As Date = Date.MinValue Dim dateStart As Date = Date.MinValue If IsDate(Me.txtPostEnd.Text) Then
[Code]....
It works fine if the day is 12 or below because it still thinks that is the month. Is there a way to force the code to recogize that I want to use dd/MM/yyyy format or even dd/MMM/yyyy format?
This has to be done at thhe vb code side as the update to the SQL server is completed via a custom framework so I can't customize the SQL code to insert the data using a CONVERT
I saw that you can also use a "Settings File" (Add new Item)to add your settings instead of the application settings. But I can't seem to write any values to the file. Someone with experience with the "Settings1.settings"?
So I've been working with DotNET for a few years now; long enough to establish solid preferences for one available element over another, one available logic over another, and then to develop preferences for aspects of elements and logics.
The one that conflicts me the most is the stock Settings construct. It's a great idea - I mean everybody needs basic data persistence that isn't worthy of databasing, right? It's implemented in a way that anybody - and I mean anybody from flat beginner to highly advanced - can benefit from it. It does some heinously stupid stuff, though; for example, it angers me (and I mean full-on, where's my crowbar-OK-now where's the silly @#*! who came up with the idea anger) that the only way to save it is the way that's hardcoded in. The .SAVE method takes no parameters, there's absolutely zero exposure for the save-path to provide a more deliberate location, so the only place any settings ever get saved is in a ridiculously long (and literally arbitrarily designated) user-profile-based path.
So what happens if/when a user is ready to upgrade their OS (or just reformat and reinstall their OS, which the kinds of people who end up on my client list are prone to do just as part of quarterly maintenance), and they want to save their personal application settings to load in the next time around? They either have to hunt out that moronically obfuscatory save location or I have to write special (and I mean riding the short-short-short bus special) code which is more or less a whole new settings class identical to the settings classes implemented in the application to begin with, just to allow them to export their settings to a known location for transfer.
And what happens if a specific setting needs special treatment beyond the basic 'changing' and 'changed' events provided by the stock class? Since any change to the Settings Designer rewrites the whole code-behind property declarations, I can't do it in that code file; I either have to extend the Settings class or get back on the short-short-short bus and write that special 'mirror-class' again.
I'm not much for just general whining though, so some time back I wrote my own serializable classes (designed for specific data persistence, like generic/universal application settings and then also MySQL server connections/credentials and then also form properties and then also application-specific settings) along with shared save and load methods which give me more control over where settings get saved. These classes have evolved over the last year or so until they're actually pretty awesome (even if that's just my opinion)... I've even implemented full on-disk and in-memory encryption functions for applications that need different privilege levels, to prevent any tampering at any time.
And then a multi-user application project comes along and suddenly each individual settings class needs multi-user support based on the Windows user logged in, and suddenly the stock Settings class is the best option again even though it's still the worst possible option in settings persistence.
So what I want to know from this discussion is this:
How do YOU handle application and user-settings persistence? Is there something really key that I've been missing all this time that makes the stock Settings class more than absolutely worthless (which has been my opinion since about the first time I ever had to work with it)?It never hurts to try. In a worst case scenario, you'll learn from it.
I would like to know if it is possible to be able to encrypt a file and have my application be able to decrypt it and ammed the file as necessary. and then when the program exits it will encrypt the file back up.
I have a custom control that as a custom property. The property has several preset values to chose from a drop down. The control can be added to a form. The property can be viewed and set in the properties box in the IDE. It all works fine.
Here's the problem: I can create new versions and recompile the control and/or the application without the properties preset value being lost as long as I do it in Debug mode. However, once I try to recompile in Release mode the custom property values predefined setting is lost. I first thought it was something with going from debug mode to release mode. But it seems to be ANY time I recompile in Release mode the custom property values are lost. Is this a quirk in VS that needs a configuration setting, etc. to get around it?
I'm just getting started with Visual Basic .NET and I'm currently stuck on the following problem: how can I encrypt/decrypt a file with asymmetric encryption?
Essentially, I'm trying to figure out how I can write the following pseudocode in VB
Has anyone used these methods? I tried File.Encrypt on a text file, and I did not get an exception, however the Encrypt method did not work (the file was unchanged afterwards).
I need some help on saving/reading xml from/to dataset. I would like to make that complete file is encrypted and not only some elements inside or part of file.Currently this is not working in any way at all.[code]
So I have a connection string which is read from a basic text file. This string contains a password. Is there anyway to encrypt this text file so that anyone can't just open it up and read it. The program will still be able to read it.
I ended up getting this properly working, as far as encrypting a file goes:How to encrypt and decrypt a file by using Visual Basic .NET or Visual Basic 2005 However, the catch is I have to change the name of the output file. What I was hoping to do is overwrite the original with the encrypted file, but when I tried that on a large file, it ended up only getting about 8 bytes of it.
Does anybody have any suggestions or recommendations? The overall idea is that I want to keep a file encrypted until it needs to be unencrypted for use by a program, but I'm not sure if there are better tools out there or if there's a better way of accomplishing this.
Question 2: I would really, really like to encrypt an entire folder, which I'm guessing would be faster than file by file, but when I try I keep getting access denied errors, even with DOS Cipher. Is there a way to do this with a key?
I made a program that encrypts data and puts it on a txt file. There are two parts of information that need to be "linked" to the other. Say its Person 1, then Person 1 gender, they need to be placed together. Each encrypted piece of seperated by a ";". I have it read the file and place the information on a Rich Text Box. How can I read all the encrypted info and stop at ";" then place that into a variable then read the next bit? I did this a while back but I used StreamReader/StreamWrite and can't remember how I did it. Right now it reads through the open file dialog and writes it to the Text Box with this command writetext.LoadFile(sFilePath, RichTextBoxStreamType.PlainText)