2
打开App.config,添加应用程序设置的5个键值
first_run: 应用程序第一次正常启动
server: 服务器IP
database: 数据库名称
uid: 数据库用户名
pwd: 数据库密码
数据库服务器配置在程序首次启动时的值都是空的
3
右键点击项目中的应用,添加一个引用,然后再你需要访问配置文件的类顶部添加 using
<Title Row="0" Cloumn="2" Contenttitle="aaa" Assemblydll="aaa.dll" InterFace="aaaaaa" ImageUrl="pack://application:,,,/TyPlatformcomponent/Images/111.png" Width="180" Height="180" ></Title>就像这样的一个XML,读成DataSet,然后这样取值
DataTable dt
DataSet ds = new DataSet()
ds.ReadXml(Environment.CurrentDirectory + "/" + path)
dt = ds.Tables[0]
string Row = dt.Rows[index]["Row"].ToString()
string Cloumn = dt.Rows[index]["Cloumn"].ToString()
string Height = dt.Rows[index]["Height"].ToString()
string Width = dt.Rows[index]["Width"].ToString()
string ImageUrl = dt.Rows[index]["ImageUrl"].ToString()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)