dlm
Wed Mar 05 16:03:41 CST 2008
This is a multi-part message in MIME format.
------=_NextPart_000_002B_01C87F15.276C2A20
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
Hi,
to read your configuration from some location you can use something =
similar to the code below:
string sPath =3D System.IO.Path.Combine( =
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData=
), "yourExe.exe");
Configuration config =3D =
ConfigurationManager.OpenExeConfiguration(sPath);
Take a look for different values of enum type Environment.SpecialFolder. =
I hope this helps you.=20
Regards,
dlm@bypsoft
Compare Databases - SQL Server, MySQL, Oracle for free
www.bypsoft.com
"Job Lot" <JobLot@discussions.microsoft.com> schrieb im Newsbeitrag =
news:751445E4-AA94-4DF8-A6EE-08F338A57B69@microsoft.com...
> How can I make my application to expect config file under =
=E2=80=9CC:\Documents and=20
> Settings\All Users\Application Data\MyApplication=E2=80=9D folder =
rather install=20
> folder.
>=20
> My app performs read/write operation on application configuration file =
that=20
> gets installed under application folder (c:\program files\My =
Application). It=20
> works alright on XP, but as soon as I run it on VISTA machine, I start =
> hitting virtualization & UAC issues.
>=20
> How can make my app run under VISTA? Can I move the config file under=20
> =E2=80=9CC:\Documents and Settings\All Users\Application Data=E2=80=9D =
folder? If yes, how=20
> can I make my app to expect config file under =E2=80=9CC:\Documents =
and Settings\All=20
> Users\Application Data=E2=80=9D rather app folder.
>=20
> Thanks
>
------=_NextPart_000_002B_01C87F15.276C2A20
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8">
<META content=3D"MSHTML 6.00.2900.3268" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>to read your configuration from some =
location you=20
can use something similar to the code below:</FONT></DIV><FONT size=3D2>
<P></FONT><FONT color=3D#0000ff size=3D2>string</FONT><FONT size=3D2> =
sPath =3D=20
System.IO.</FONT><FONT color=3D#008080 size=3D2>Path</FONT><FONT =
size=3D2>.Combine(=20
</FONT><FONT color=3D#008080 size=3D2>Environment</FONT><FONT=20
size=3D2>.GetFolderPath(</FONT><FONT color=3D#008080 =
size=3D2>Environment</FONT><FONT=20
size=3D2>.</FONT><FONT color=3D#008080 =
size=3D2>SpecialFolder</FONT><FONT=20
size=3D2>.CommonApplicationData), </FONT><FONT color=3D#800000=20
size=3D2>"yourExe.exe"</FONT><FONT size=3D2>);</P>
<P></FONT><FONT color=3D#008080 size=3D2>Configuration</FONT><FONT =
size=3D2> config =3D=20
</FONT><FONT color=3D#008080 size=3D2>ConfigurationManager</FONT><FONT=20
size=3D2>.OpenExeConfiguration(sPath);</FONT></P>
<P><FONT size=3D2><FONT face=3DArial>Take a look for different values of =
enum type=20
Environment.SpecialFolder. </FONT></FONT></P>
<P><FONT size=3D2><FONT face=3DArial>I hope this helps you. =
</FONT></FONT></P>
<P><FONT size=3D2><FONT face=3DArial>Regards,</FONT></FONT></P>
<ADDRESS><FONT face=3DArial size=3D2><A=20
href=3D"mailto:dlm@bypsoft">dlm@bypsoft</A></FONT></ADDRESS>
<ADDRESS><FONT face=3DArial size=3D2><A=20
href=3D"
http://www.bypsoft.com/dbtyp.html">Compare Databases - SQL =
Server, MySQL,=20
Oracle for free</A></FONT></ADDRESS>
<ADDRESS><A href=3D"
http://www.bypsoft.com"><FONT face=3DArial=20
size=3D2>www.bypsoft.com</FONT></A></ADDRESS>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>"Job Lot" <</FONT><A=20
href=3D"mailto:JobLot@discussions.microsoft.com"><FONT face=3DArial=20
size=3D2>JobLot@discussions.microsoft.com</FONT></A><FONT face=3DArial =
size=3D2>>=20
schrieb im Newsbeitrag </FONT><A=20
href=3D"news:751445E4-AA94-4DF8-A6EE-08F338A57B69@microsoft.com"><FONT =
face=3DArial=20
size=3D2>news:751445E4-AA94-4DF8-A6EE-08F338A57B69@microsoft.com</FONT></=
A><FONT=20
face=3DArial size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>> =
How can I make my=20
application to expect config file under =E2=80=9CC:\Documents and =
<BR>> Settings\All=20
Users\Application Data\MyApplication=E2=80=9D folder rather install =
<BR>>=20
folder.<BR>> <BR>> My app performs read/write operation on =
application=20
configuration file that <BR>> gets installed under application folder =
(c:\program files\My Application). It <BR>> works alright on XP, but =
as soon=20
as I run it on VISTA machine, I start <BR>> hitting virtualization =
& UAC=20
issues.<BR>> <BR>> How can make my app run under VISTA? Can I move =
the=20
config file under <BR>> =E2=80=9CC:\Documents and Settings\All =
Users\Application=20
Data=E2=80=9D folder? If yes, how <BR>> can I make my app to expect =
config file under=20
=E2=80=9CC:\Documents and Settings\All <BR>> Users\Application =
Data=E2=80=9D rather app=20
folder.<BR>> <BR>> Thanks<BR>></FONT></BODY></HTML>
------=_NextPart_000_002B_01C87F15.276C2A20--