Reading and Writing to Config Files

Hi Everyone,

I have a situation where I need to read another applications .config 
file. I will have to add new nodes to various parts of the config file. 
(It is actually the IIS 7 applicationHost.config file)

I am using C# to do this.

What would be the best way to approach something like this? I have very 
little experience in using XML (which for a web developer is supprising 
- it just something I have not used as yet)

Kind Regards
Mick
0
10/30/2007 9:53:51 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
435 Views

Similar Articles

[PageSpeed] 49

Mick Walker wrote:

> I have a situation where I need to read another applications .config 
> file. I will have to add new nodes to various parts of the config file. 
> (It is actually the IIS 7 applicationHost.config file)
> 
> I am using C# to do this.
> 
> What would be the best way to approach something like this? I have very 
> little experience in using XML (which for a web developer is supprising 
> - it just something I have not used as yet)

System.Xml.XmlDocument is the API in the .NET framework 1.x and 2.x to 
manipulate XML documents.
With .NET 3.5 (currently in beta) there is also LINQ to XML.

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
10/31/2007 2:37:48 PM
Reply:

Similar Artilces:

Reading .wks file
Greetings...according to the Excel "help" file, as well as the file extension listing, I *should* be able to read an *.wks file, but Excel insists that it cannot. I am pretty sure the file was created in Microsoft Works. Is there a converter somewhere that I can download/install? Cheers - S2 Excel can read Works 2.0, not later. You have to save them in Works as excel files or Works 2.0 or get a commercial converter. -- Regards, Peo Sjoblom "Skip Stocks" <anonymous@discussions.microsoft.com> wrote in message news:AFC110E0-641D-4D87-9464-B930CC41CF02@microsoft....

Inserting text from a .txt file
I'm trying really hard to jump on the bandwagon and migrate from Outlook Express to Outlook, but the more I try, the more frustrated I get. Anyway, here is my question: How do I insert the text from a text file into my e-mail document. I am using the rtf editor. thank you, ~alan copy/paste? "~~Alan~~" <alan.shepro_NOSPAM@verizon.net> wrote in message news:%23%23AwZrIKEHA.1264@TK2MSFTNGP12.phx.gbl... > I'm trying really hard to jump on the bandwagon and migrate from Outlook > Express to Outlook, but the more I try, the more frustrated I get. > > Anywa...

xml config file...
hello, I ve a Windowsapplication with a configuration file app.config... (it's in xml) code app.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name = "MyNameValueSection" type="System.Configuration.NameValueSectionHandler" /> </configSections> <MyNameValueSection> <add key="MyKey" value="MyValue" /> </MyNameValueSection> <appSettings> <add key="test" value="MeinInhalt" /> </appSettings> </configurati...

Import txt file into excel with 281,344 rows
Hi, I've got a very large txt file that I need to import into excel. It has 288,344 rows. Is there a way I can do this? The fields on my txt file are separated by a pipe "|" Thanks in advance. If you're using xl2007, then that data will fit. Open the .txt file and choose delimited by | If you're using xl2003 and below, you could use your favorite text editor to make several smaller .txt files (65536 rows or smaller) and import each into separate worksheets. JulieM39 wrote: > > Hi, I've got a very large txt file that I need to impo...

error attaching file to email
Getting the error: File Upload Failure There was a problem while attempting to upload the requested file. Check the path and try again. The file is a pdf, about 74 KB. Any ideas?? ...

path of .pst file
Hello everyone, I want to develop a stand alone application to send and recieve mails through MS Outlook.how can i retrieve the path of .pst file from .net application. actually i am thinking of reading the pst file of MS Outlook. is it possible? Thanks in Advance jyoti The pst file is stored in the profile path of the MSOUTLOK Since the path of the pst can be varied by the user, as can its name, ie it neednt be in the install default path, your app would first have to search for the pst, then you would have to figure out if it/which was the current pst. There are alleged to be third ...

Weird files
Just noticed I've got a ton of weird files with names like 2BE48300. The normal files seem to be ok. Any idea what might be producing all these extra files? -- For a list of all the ways technology has failed to improve the quality of life, please press three. ....Alice Kahn Not sure. Perhaps cleaning up your hard drive will help. http://www.officearticles.com/misc/how_to_clean_up_your_hard_drive.htm Are they Excel files? **************************** Hope it helps! Anne Troy www.OfficeArticles.com **************************** "Steve" <teu@qprc.inv> wrote in message...

"File access denied" to PST file
I have gone from Windows 2000 running Outlook 2000 to Windows XP Pro running Outlook 2003. When I try opening my saved .pst file in the new Outlook I get a message saying "File access denied. You do not have permission required to access to file mailbox.pst" I am logged on as Administrator, as I was on the old install. How do I open my saved mailbox.pst or archive.pst? TIA How did you try opening it? is this a local .pst file? If it is not on your C: drive, is it marked Read-Only? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion int...

File won't open as read only
I have a file that is in use, but another person opens it and it doeasn't display the "file is in use" message. Is there a setting or fix? Hi have you shared this file? -- Regards Frank Kabel Frankfurt, Germany John wrote: > I have a file that is in use, but another person opens it > and it doeasn't display the "file is in use" message. Is > there a setting or fix? The file is on a network share. The share has all the appropriate permissions. >-----Original Message----- >Hi >have you shared this file? > >-- >Regards >Frank Ka...

How to give other users read-only access to Calendar
I want to allow the group Everyone to have read-only access to a calendar in a certain mailbox. I can do this by granting the permission 'Full mailbox access' (under 'Mailbox rights', under 'Exchange Advanced', for the particular user). However this also allows people to to do everything (ie: they become read-write users). I notice that every mailbox in the system has 'Read permissions' granted to group Everyone. This does not allow other people to open items in the mailbox, but as I understand it, permits Exchange Server and Outlook to do shared meetin...

Delete oldest file first
All, I am looking for some code that deletes the oldest files first in a directory. Any help would be great. Thanks in advance. "karibbean" <sharp_mind@REMOVE.this.email.msn.dotcom> wrote in message news:uJZArpxvFHA.2132@TK2MSFTNGP15.phx.gbl... > I am looking for some code that deletes the oldest files first in a > directory. Any help would be great. Thanks in advance. See FindFirstFile, FindNextFile, FindClose, DeleteFile -- With best wishes, Igor Tandetnik With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is ...

View Pub 2002 files in home pub 2000
My wife did some work with Pub 2002 and we tried to view the files on our home computer that has home pub 2000. It did not recognize the .pub file extension. I tried to save the files as pub 2000 on her computer but still no good. The file extension that home pub 2000 recognize's .php , is there a way I can view these? Sorry - Home Publishing is not the same as Publisher. You could create a ..pdf file and view that. If you don't have Acrobat, you can download a free program from PrimoPDF (www.PrimoPDF.com). I will forewarn you, if you don't have broadband, it will take a while...

Need parameter to write data to table: please help!
I have a query that tells me how long each batch will take to make in the factory. The fields are: release date, priority, status, work order number, vessel, vessel group, and total time. I would like to input the start time for the highest priority (lowest number) batch for each vessel group. I am going to use a form for this. How do I write a parameter to only use the start date I input for the lowest numbered priority in each vessel group? Create your form first. Then wherever you want to use the start date in your query, just right click and select build.. then browse to your f...

Make excel 2003 default to open files
I have Excel 2003 running alongside 2007. Double clicking an excel file causes it to open in 2007; how do I force 2003 to open the files instead? Sandy You most likely have to reset your file association from 2007 to 2003. Close Excel first and On the Windows Taskbar 1) Start>Run "excel.exe /unregserver"(no quotes)>OK. 2) Start>Run "excel.exe /regserver"(no quotes)>OK. See the space between exe and /regserver You might have to designate a full path to excel.exe for Office 2003 In that case Start>Run "C:\your path to\office11\excel.exe" ...

Read mail arn't marked as read anymore
After an SP upgrade of my Office 2000 the priviewed mail doesnt get marked as read anymore. I have tried to change the time (Tools->Options->Priview pane) from 2 -> 3 -> 4 seconds but nothing works. The only way to mark a mail as read is either to open it or right click it and chose Mark as read. Since I only use the priview pane this is very anoying for me. Is this a bug or has some setting changed with the SP? ...

scrambled excel file
Hi AGAIN. I'm trying to open a file that was deleted and later retrieved through GetData Back. It has an .xls extension, but when I try to open it, it's just symbols. Is there some way I can retrieve the proper info. from that file? Do I have to save it as something else? I really need this file back - l mean life & death!! I will attach the file to see if someone can figure this out for me. Thanks again for your help. Your advice last time was great. Sandy Attachment filename: wolf_info liz.xls Download attachment: http://www.excelforum.com/attachment.ph...

bad debt write offs
How do I post bad debt write offs? I need the write off to reduce the payees balance so they don't show up on a receivables report anymore. I tried creating an expense to offset the uncollectable debt but the payee still shows an outstanding balance. Help please! "Tara in Austin" <Tara in Austin@discussions.microsoft.com> wrote in message news:9A723321-EAE8-42F3-9588-7DFF7C2A56F0@microsoft.com... > How do I post bad debt write offs? I need the write off to reduce the > payees > balance so they don't show up on a receivables report anymore. I tried &g...

excel file can not be accessed
When opening an excel file I get an error that reads " 'Excel File Name.xls' cannot be accessed. The file may be read-only, or you may be trying to access a read-only location. Or, the server the document is stored on may not be responding." The file is not read-only. The other files in the same location are readable. The document is stored on a local drive. Any suggestions on how to read the file? Thanks for your time. Dave Could this be it? http://www.contextures.com/xlfaqApp.html#ReadOnly (from Debra Dalgleish's site) Dave wrote: > > When op...

Web page file name output
My client has a 100 page publisher document and I am trying to convert that to Web pages. It works BUT, the out put files file names that don't make sense. I end up with Page1152.htm, Page1351.htm, Page1390.htm and not page 1, 2, 3 etc that I would expect. I can't see any rhyme or reason to the page numbers that it outputs. I would have thought that it would use the emended page numbers within the document. Is there a way to make the Web output the pages Page1.htm, Page2.htm etc? Dan The bad new is that is the way both Publisher 2003 and 2007 work by design and default....and ...

open pst file?
I received an email on outlook and saved it to a file in my docs to review later. Now, I tried to open a pst file in the email and was given a message that there is no program available to open it, or something to that effect. I have gone to the office website--no info. I read the discussion postings here and the closest one seems to suggest a solution through explorer somehow. I am not versed in these issues. It would seem there would be a built-in solution for this but apparently not. I am stuck! You have to use your email client to import a PST file. Go to FILE>IMPORT AND E...

Close Outlook in Batch File
I have a batch file that backs up all the networked computers in the office to the server. This program will back up the Outlook (pst) file if the employee remembers to close Outlook. Is there a command line I can use in my batch program that will close Outlook? ...

Several files opening at the same time
I have a shortcut on my Quick Launch bar to a file called Index.xls wherein other hyperlinks take me to a zillion other places as a means of organisation of my computer data. For a couple of months I've been finding that whenever I click Index.xls another file called PERSONAL.XLS opens as well (or in fact momentarily before). I don't know why this is happening. As far as I know I did not change anything that might cause this phenomenon. I located PERSONAL.XLS and changed the filename to PERSONAL.XL1 to see if that might prevent it from opening, but now I have PERSONAL.XL1, PERSONA...

reading confirmation
Good day, I have a problem with outlook. When they send a message to me that demands the shipment of a reading confirmation, even if I accept, the reading confirmation does not come received from the sender. Someone knows from what depends and in which way I can resolve the problem? Thanks for the eventual answers. Niki In news:eht7fo$251$1@fata.cs.interbusiness.it, Niki <nicola.pantaleo@yahoo.it> typed: > Good day, > > I have a problem with outlook. When they send a message to me that > demands the shipment of a reading confirmation, even if I accept, the > read...

"Unblock" feature should be optional when reading e-mail in CRM
When viewing e-mail messages in CRM, a line appears saying "Unblock" to allow the full message content to be read. Can this be made a configurable server or security setting? We are trying to reduce "clicks" as much as possible. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agre...

File, Send, Message to Mail Recipient
Hi there. We use Sage line 50 and send mail via Outlook to recipients. This has stopped working. We've reinstalled Sage, reinstalled Office 2000, removed and reinstalled both and even installed office 2003 to try and get it working again. From Word, we can send to, but not Sage. Anyone have any ideas? Regards, Neal Blackie. Have you checked Sage's support? Integration with Office/Outlook is something that they would be responsible for, not Microsoft. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest v...