Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 25th, 2007, 08:45 PM
Registered User
 
Join Date: May 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to get the directory of app.config

When the app.config compile,its name will change into project.exe.config and copy itself to another place.
When I use
FileInfo file=new FileInfo("app.config")
to get the directory, it will get the directory of project.exe.config. But I want ot get the directory of app.config.
AppDomain.CurrentDomain.SetupInformation.Configura tionFile is also the same.
How can I do?
  Thanks for you help.
 
Old May 27th, 2007, 09:29 PM
Registered User
 
Join Date: May 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why don't someone give me response ? Am not I express distinct ?

 
Old May 28th, 2007, 02:55 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Quote:
quote:Originally posted by cczhangjm
 Why don't someone give me response ? Am not I express distinct ?
Well it's hard to see why what you've got isn't helping.

AppDomain.CurrentDomain.ApplicationBase gets the application folder's name, or use FileInfo with AppDomain.CurrentDomain.SetupInformation.Configura tionFile and then use the Directory property.

--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
web.config vs. app.config darlo Visual Studio 2005 11 August 20th, 2008 07:23 AM
Using Connection Strings - App.config testsubject Visual Studio 2005 1 July 16th, 2007 01:08 AM
How to access app.config in C# ? cczhangjm XML 2 May 16th, 2007 07:43 PM
Chapter 8 - app.config jotto BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 2 March 21st, 2006 05:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.