如何为我的程序构建config.ini? [英] How can I build config.ini for my program?

查看:93
本文介绍了如何为我的程序构建config.ini?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,你可以看到标题。我正在尝试构建一个config.ini将自动定位并在exe路径中生成..但是。我不能处理它。每次我这样做,我都会把你的来源作为一个菜鸟腐败。



我想做什么?



我想要这个ini加载程序。它将修改我将设置的一些选项(自动生成路径集我创建了一个表单来自动启动一些exes,每次运行此表单时,它都会将文本框重置为空字段。)(自动设置sql连接像sqlconnection = 1 - >当它加载时,sql连接将自动运行,最新的成功连接发生在程序sqlconnection = 0 - >加载时,它不会加载sql连接。谁运行程序应该手动完成)

Well , as you can see the title . I''m trying to build a config.ini will be located and generated in the exe path automatically .. but . I can''t process it . every time I do it , I corrupt the source as a noob .

What am I trying to do?

I wanna this ini to be loaded for the program . and it will modify some options I will set like ( Auto generate path set " I created a form to launch some exes automatically , and every time I run this form , it reset the textboxes to empty fields. " ) ( Setting the sql connection automatic like sqlconnection = 1 -> when it loads , the sql connection will run automatically with the latest success connection happen in the program sqlconnection = 0 -> when it loads , it won''t load the sql connection . who ran the program should do it manually )

推荐答案

XML!



我建议您使用 XML ,并且有大量现成的文章,其中包含以下代码:



- XML配置文件变得简单......最后! [ ^ ]

- http:// codesamplez.com/development/application-settings-c-sharp [ ^ ]

- 推荐:

--- linq-to-xml / [ ^ ]

--- understanding-c-simple-linq-to.html [ ^ ]



干杯,

Edo
XML!

I''d suggest you use XML and there are loads of off-the-shelf articles with code for that:

- XML configuration files made simple... at last![^]
- http://codesamplez.com/development/application-settings-c-sharp[^]
- Recommended:
--- linq-to-xml/[^]
--- understanding-c-simple-linq-to.html[^]

Cheers,
Edo


这篇关于如何为我的程序构建config.ini?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆