How to Add a Configuration File to your Windows Forms application Paano Magdagdag ng isang Configuration File na iyong Windows Forms application
When you are creating a new Windows Forms application, it isn't immediately obvious how to get a configuration file for your application. Kapag kayo ay lumilikha ng isang bagong Windows Forms application, ito ay hindi agad-agad halata kung paano makakuha ng isang configuration file para sa iyong application. Your application configuration file is supposed to be called executablename.exe.config, and should be in the same directory as your application in order for the .NET framework to automatically use it. Ang iyong aplikasyon configuration file ay dapat na tinatawag na executablename.exe.config, at dapat sa parehong directory ng iyong aplikasyon sa order para sa. NET framework upang awtomatikong gamitin ito.
But when you create the configuration file in the \bin\debug directory, it gets overwritten immediately when you do a new build. Ngunit kapag ikaw ay gumawa ng mga configuration file sa \ bin \ debug direktoryo, ito ay makakakuha ng mapapatungan kaagad kapag gagawin mo ang isang bagong build. That's slightly annoying. Iyan ay bahagyang nakakainis.
The proper way to add this file is to add new new configuration file called App.config to your project, which Visual Studio will automatically copy and rename to the same name as your executable's name when you do a build. Ang tamang paraan upang idagdag ang file na ito ay upang magdagdag ng bagong mga bagong configuration file na tinatawag na App.config sa iyong mga proyekto, kung saan ang Visual Studio ay awtomatikong kopyahin at palitan ang pangalan sa parehong pangalan bilang iyong maipapatupad na ang pangalan ko kapag ka ng isang build.
There's a really simple way to do this.. May isang tunay simpleng paraan upang gawin ito .. simply go to the File \ Add New Item menu, or hit Ctrl+Shift+A lamang na pumunta sa File \ Add New Item menu, o pindutin ang Ctrl + Shift + A 
You'll notice that it's already set to App.config for you. Mapapansin mo na ito ay naka-set sa App.config para sa iyo. Just hit the Open button. Pindutin lamang ang pindutan ng Buksan.
If you look in the Solution Explorer, you will see that the config file is in your project: Kung titingnan mo sa solusyon Explorer, makikita mo na ang config file ay sa iyong mga proyekto:

Now build your application, and take a look in the \bin\debug\ folder. Ngayon magtayo ang inyong aplikasyon, at kumuha ng tumingin sa \ bin \ debug \ folder. You'll see that the configuration file has automatically been generated and named correctly for your executable: Makikita mo na ang mga configuration file ay awtomatikong nalikha at pinangalanan ng tama para sa iyong mga maipapatupad na:

If you change the name of the outputted file, Visual Studio is smart enough to generate the new filename correctly. Kung binago mo ang pangalan ng outputted file, Visual Studio ay matalino na sapat na upang makabuo ng bagong filename ng tama.
Enjoy Configuring! Enjoy-configure!

Daily Email Updates Araw-araw na Updates Email
You can get our how-to articles in your inbox each day for free. Maaari kang makakuha ng aming kung-paano na mga artikulo sa iyong inbox sa bawat araw para sa libre. Just enter your name and email below: Ilagay lamang ang inyong pangalan at email sa ibaba:



thank you very much really helpful , thanks a lot thank you very much talagang helpful, thanks a lot