473,657 Members | 2,585 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

(c#) how do i disable the code from configuration file? (the xml.. the .config file)

7 New Member
hi all,

i have this program that will run and the result is based on the .config file.
how do i disable the code from the config file ?

for example...

i want some method to not functioning when i change the variable in the config file..

e.g:

my .exe file will copy and delete files at the same time..
how do i disable the copy function so that the .exe will only delete when i reun the exe file.

of course i can determine it in the .config file..


thanks..

if possible can reply asap!
Jun 21 '07 #1
3 1938
kenobewan
4,871 Recognized Expert Specialist
If I understand you correctly, delete the variable from the web.config and add it programmtically . If not please give a clearer explanation. Thank.
Jun 21 '07 #2
halimunan
7 New Member
erm.. okay, let me give a clearer explanation...

- my .exe program will run to copy and delete files at the same time.

- it will copy from folder "a" to folder "b"

- and then delete some files from both folders

- the copy and delete depends on the variable which i can determine in the .config file

- how do make the .exe file "just delete and not copy" ?? which also means that i disable the copyFile codes from the source

- or is there any other way rather than disabling the copyFile code(which is the only way i`ve been thinking of) ??


- its actually a backup program which can copy from folder "a" to folder "b" and delete files at whichever folder depending on the days to be retained

- e.g: it will delete only files that are 5 days old. and that days are configurable in the .config file

- so how do i make the .exe program running without copying the file.. just deleting the file.. and i should do that in the .config file only..

- thanks for the help..

- p/s 1 more thing : i couldnt delete the folders in the folder.. sigh.. it keeps checking the "read only" attributes

- even after i unchecked it.. can anyony help?
Jun 22 '07 #3
kenobewan
4,871 Recognized Expert Specialist
I was thinking that there was a way to not use the web.config to delete files and do it programmaticall y, but this not you want. There is also deletefile. Anyone else?
Jun 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3452
by: kathy | last post by:
What Application Configuration File is? And when/where/how to use it? Any documents on that? MSDN has somrthings scatter everywhere - hard to follow. thanks,
0
263
by: runningdog | last post by:
HI, Sorry if this is a bit long winded I'm working on a suite of winapps that need to use two levels of configuration data; application level and solution level. I found a reference on MSDN that suggested that app.config file can import data from another file at runtime. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/tdlg_ch4.asp So I created a solution and added app.config and user.config as follows
1
360
by: Raymond Cheung | last post by:
How do I disable to show xml file content on web browser from across domain. I know we can have some sort of enbcription on the xml file content. I also know that we can use authentication to control the display of xml file. However, I want to assume the user is authenticated in the directory where I have the haha.xml file. Yet, the user would not be able to see the content of the xml file as below ie) When some one type ...
0
5312
by: phillip | last post by:
This is interesting, I have attached my web.config file and the exception I have been logging. I created a library which provide data access to a database and a control system. The library is written in C#. I created a small .exe file to test that the library builds propertly from configuration and that it communicates properly. This work great in the System.Windows.Forms. However, when I use the library in a web enviroment things...
3
3865
by: Nuno | last post by:
At first, I was trying to encrypt ConnectionStrings in my app.config and still be able to modify my datasets. So, i had to modify the Settings.Designer.cs file to handle the decryption aspect in the GET properties. This works great to run the application but there are two problems with it when developing at designtime. 1. Anytime i add another setting to Properties, the Designer rewrites the Settings.Designer.cs overwritting my...
3
32119
by: John K | last post by:
I am trying to eliminate the capability of displaying the details of a web service by disabling WSDL generation in the web.config file. I have made the following changes to the web.config: <webServices> <wsdlHelpGenerator href="helpPage.aspx"/> <protocols> <remove name="Documentation" /> </protocols> </webServices>
10
8077
by: Gary Jefferson | last post by:
Suppose I have 3 modules that belong to a project, 'A', 'A.a' and 'B', and each module has its own logger, created with: module1logger = logging.getLogger('project.A') and module2logger = logging.getLogger('project.A.a') and
1
1464
by: Piotrekk | last post by:
Hi I have a strange problem. Here is some input data before I describe the problem. 1. RemoteClass (Mathematica) is compiled into dll and put to GAC 2. Server remoting configuration is done by code. //used in case of code configuration TcpChannel channel = new TcpChannel(5000);
0
1168
by: jasonburton | last post by:
I have an application that has been ported over the years through multiple development environments and has tens of thousands of customer installs. Currently, I'm trying to port from it Visual Studio 2003 to VS 2008. My program has historically read a file called <executable name>.config with an application-specific format and use, but now VS 2008 creates a ConfigurationManager object that tries to read this same file as an XML file. When...
0
8397
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2731
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1620
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.