C# :: Change Settings In User Config Of Different Applications Directly
Jan 10, 2014
I have a service that has some settings. As the service is running as a system user, the settings file is located in
C:Windowssystem32configsystemprofileAppDataLocal<PRODUCTNAME><ExecutableName+GUID><VERSION>user.config
Now i want to be able to change some settings at runtime using a normal Winforms App. Is there a good and easy way to change the user.config of a different application directly? I tried with ConfigurationManager but that does not seem to work.
View 8 Replies
Oct 11, 2014
My current idea of how to work with user settings goes like this:
1. Create a class to hold all of the user settings.
2. Use that class to load/save/hold settings in memory.
3. Create an instance of that class once in the entry point of the program (int Main or whatever).
4. Pass, by reference this same class instance around to all of the other classes that need the user settings.
5. Once all other objects deleted, save and then delete the User Settings class.
I created a psuedo-code example below of this. My question is if this is the best way or should I be doing something else. In particular, I am wondering if somehow I can avoid passing the settings class by reference all of the time. Would this be a good case scenario for a "Singleton" type class?
#include <string>
class UserSettings {
private:
std::string SettingOne;
int SettingTwo;
bool SettingThree:
[Code] ....
View 9 Replies
View Related
Jul 9, 2013
I will sketch the scenario I would like to get working below. I have one main application.
That application, based on user interactions, can load other applications in a secure shell. This means these child applications cannot interact with the OS anymore, nor with each other.
The parent program can at any time call functions of these child programs.
The child program can at any time call functions of these parent programs.
How to implement this in C++? Preferably both parent and child should be written in C++.
The performance of loading the child applications doesn't matter. The only thing that matters is the performance of the communication between child and parent.
View 4 Replies
View Related
Jan 31, 2013
I need to create a GlobalConfig class. But I want to derive from it in another class.
Here's an example:
public class BaseConfig {
public string GlobalPath {get; set;}
}
public class ConfigA : BaseConfig {
public string pathA {get; set;}
}
public class ConfigB : ConfigA {
public string pathB {get; set;}
}
The idea behind is that I don't want to write the code multiple times and what's more important in class ConfigA I want to set GlobalPath and have access to it in ConfigB.
In other word I want class ConfigB to have a property GlobalPath which was set in class ConfigA.
To clarify I want to have only one object of Config in memory.
When I set BaseConf.GlobalPath to 'A', I want to access it from ConfigB.GlobalPath and also get 'A'.
I always design GlobalConfig as a static class, but static classes can't be inherited. So I tried to implement Singleton Pattern, but ConfigA can't find constructor of class BaseConfig because it's private.
View 1 Replies
View Related
Aug 26, 2014
I'm trying to make a basic settings text file and I'm wondering why pos_y = strAxisData.find(",", pos_x, strAxisData.length()); returns std::string::npos when pos_y = strAxisData.find(","); works fine ? The settings text file format is:
string strAxisData;
while(finConfig)
{
getline(finConfig, strAxisData);
pos_x = strAxisData.find("=");
if(pos_x != std::string::npos)
}
[code]....
View 1 Replies
View Related
Jan 1, 2015
I'm working a personal project where I have two applications namely Server, Client. when Server is started, it continuously transmits data. When Client is opened, it is ready to consume the data and display it.
I will put both .exe files in a shared location (LAN). Therefore Sever and Client will be launched from different machines. When I searched for articles that teach how to establish communication between the two, I was offered with choices like NamedPipes, WCF, Polling etc.. I'm not sure whether they will work in a LAN based environment.Also are there any other means of establishing communication?
View 4 Replies
View Related
Nov 22, 2013
I want to configure netbeans 7.4 settings for c++.I'm posting here because netbeans forums are close to dead. How to do the following things :-
1) When you create a new project of a 'new application' type, main.cpp is already there with some code. I want that main.cpp to be completely empty when I create a new project.
2) When you compile/build your program and run it, the output is shown in a small log window at the bottom. I want it to be shown like in a black output terminal (console ?) just like in Visual Studio or CodeBlocks. (I have some reasons for not using them instead, so don't bother about me not using them)
3) When you click the green 'Run' icon in the upper toolbar, the project is compiled/build again and then runs afterwards. I want it to just run without compiling. (Compiling/Building should be done by 'Build' icon, just like in CodeBlocks or Visual Studio)
View 3 Replies
View Related
Feb 6, 2014
I am writing a simple file/text parser to read a config file for some code I am working on. It's dead simple and not particularly smart but it should get the job done. The code reads a config file:
Code:
readlength=2500000
start=0
finish=25000000
cutoff=20000
samplingfreq=250000
poles=10
filterpadding=500
}
[code]....
Here is where it gets wierd. You'll notice that there is an unused variable (filepath) in the config struct. This variable is not referenced or used anywhere in the code, ever. Yet if I comment out the declaration of char filepath[1024], the code segfaults partway through the read_config() function.
My best guess is that there is a buffer overflow elsewhere and it just so happens that the memory allocated for filepath happened to be there to catch it up until now, but I can't work out where it might be happening. With the declaration commented out, the read_config() function gets as far as reading the "padding" variable before it crashes. Yet when the declaration is there, then all the variabled are read correctly and everything seems to work.
View 10 Replies
View Related
Feb 18, 2014
I am using VC++ 2005, Multibyte char set. I am getting hex values from stream and i have to show it in respective language.
in below example
char mt[] = { 0x0C, 0x85, 0x0C, 0x86, 0x0C, 0x87,0x0C, 0x88,0x0C, 0x89, 0x0C, 0x8A,0x0C, 0x8B,
0x0c, 0x85 , 0x0c , 0x86 , 0x0c , 0x87 , 0x0c , 0x88 , 0x0c , 0x89 , 0x0c , 0x8a , 0x0c , 0x8b , 0x00 , 0x20,
0x0c, 0x8e , 0x0c , 0x8f , 0x0c , 0x90 , 0x0c , 0x92 , 0x0c , 0x93 , 0x0c , 0x94 , 0x00 , 0x20 , 0x0c , 0x95,
0x0c, 0x96 , 0x0c , 0x97 , 0x0c , 0x98 , 0x0c , 0x99 , 0x00 , 0x20 , 0x0c , 0x9a , 0x0c , 0x9b , 0x0c , 0x9c,
0x0c, 0x9d , 0x0c , 0x9e , 0x00 , 0x20 , 0x0c , 0x9f , 0x0c , 0xa0 , 0x0c , 0xa1 , 0x0c , 0xa2 , 0x0c , 0xa3,
0x00, 0x20 , 0x0c , 0xa4 , 0x0c , 0xa5 , 0x0c , 0xa6 , 0x0c , 0xa7 , 0x0c , 0xa8 , 0x00 , 0x20 , 0x0c , 0xaa,
0x0c, 0xab , 0x0c , 0xac , 0x0c , 0xad , 0x0c , 0xae , 0x00 , 0x20 , 0x0c , 0xaf , 0x0c , 0xb0 , 0x0c , 0xb2,
0x0c, 0xb5 , 0x0c , 0xb6};
How can i convert the mt string to below string?
"ಅಆಇಈಉಊಋ ಎಏಐಒಓಔ ಕಖಗಘಙ ಚಛಜಝಞ ಟಠಡಢಣ ತಥದಧನ ಪಫಬಭಮ ಯರಲವಶ"
To cross check the mt array, If you place the above string to the below link you get mt array [URL] ....
Cant i do it in "Multibyte char set" settings? or should i use Unicode settings.
View 3 Replies
View Related
Sep 30, 2014
I need to write a windows form application that allows the user to enter a credit card number and credit card type and then determines whether it is a valid number using the following rules:
1.) the first number is:
a. 4 for visa
b. 5 for master card
c. 37 for american express
d. 6 for discover
2.) passes the mod 10/ luhn check, which is calculated as:
a. from right to left, multiply every other digit by 2. when doubling a digit results in a two digit number, add the numbers to get
a single digit. ( like 6 * 2 = 12 therefore 1 + 2 = 3).
b. add all the single digits from 2a
c. add all the odd places from right to left in the card number
d. sum the results fro steps 2b and 2c
e. if the resulting number in 2c is divisible by 10, the card number is valid otherwise it is invalid.
The chapter is introducing methods so that is the main thing i will be using for each step.
View 1 Replies
View Related
Jul 31, 2012
I've created a solution who exported Access reports (graphics/tables) to a Word- and a PDF-format. Therefor I use PDFSharp and PDFFocus.
The PDF document is okay. But the Word-document looks good. Only the size of the Word-document, it has to send by e-mail, is much too big (17MB).
I have to open the Word document again to change the PageSettings to be sure, that the page-margins and the print orientation are correct.
using System;
using Microsoft.Office.Interop.Word;
namespace PageSetup {
class TestPageOrientation {
static void Main(string[] args)
[Code] .....
I don't know how it works in the Word-library source. But I've tried WdOrientation.wdOrientPortrait and once I was surprised. I saw this page in Landscape-format.
I think there is something wrong with my document sections, because the documents (with a lot of tables, graphics and a image) is much too big. And that's only after using this method.
So my next question is: How can I shrink the size of this Word document?
And what do I have to do to limit the amount of format-settings in this word-document?
View 1 Replies
View Related