国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
在.net界面中修改web.config/app.config配置

app.config:

 

 1
<appSettings>
 2
            
<!--數(shù)據(jù)庫(kù)連接字符串-->
 3
            
<add key="ConnectionString" value="Data Source=192.168.1.1;InitialCatalog=DataBase;Persist Security Info=True;User ID=sa;Password=sa" />
 4
            
<!--服務(wù)器地址-->
 5
            
<add key="ServerIP" value="192.168.1.2" />
 6
            
<!--考試子系統(tǒng)路徑-->
 7
            
<add key="exePath" value="C:\\Program Files\\Exam\\Exam.exe"/>
 8
            
<!--風(fēng)格設(shè)置-->
 9
            
<!--可選風(fēng)格 vista1.ssk、MP10.ssk、MSN.ssk、OneBlue.ssk、vista1_green.ssk、XPBlue.ssk-->
10
            
<add key="skinName" value="XPBlue.ssk" />
11
            
<!--自動(dòng)更新升級(jí)-->
12
            
<add key="AutoUpdate" value="false" />
13
</appSettings>

C#Code:

讀取app.config配置

 1
        private void GetSystemArgs()
 2
        
{
 3
            
string path = AppDomain.CurrentDomain.BaseDirectory + @"\\SC.exe.config";
 4
            
if (!File.Exists(path))
 5
                
return;
 6
            XmlDocument xmlDoc 
= new XmlDocument();
 7
            xmlDoc.Load(path);
 8
            XmlNode root 
= xmlDoc.DocumentElement;
 9
            XmlNodeList xmlNodes 
= root.SelectNodes("appSettings/add");
10
            XmlNode nodeConnectionString 
= xmlNodes[0];
11
            XmlNode nodeServerIP 
= xmlNodes[1];
12
            XmlNode nodeAutoUpdate 
= xmlNodes[4];
13
            
string ConnectionString = nodeConnectionString.Attributes["value"].InnerText;
14
            
string[] connStr = System.Text.RegularExpressions.Regex.Split(ConnectionString, ";");
15
            
string DataSource = connStr[0].Substring(connStr[0].IndexOf('=')+1);
16
            
string UserID = connStr[3].Substring(connStr[3].IndexOf('='+ 1);
17
            
string Password = connStr[4].Substring(connStr[4].IndexOf('='+ 1);
18
            
string ServerIP = nodeServerIP.Attributes["value"].InnerText;
19
            
bool check = bool.Parse(nodeAutoUpdate.Attributes["value"].InnerText);
20

21
            txtServer.Text 
= DataSource;
22
            txtUserName.Text 
= UserID;
23
            txtPass.Text 
= Password;
24
            txtFilePath.Text 
= ServerIP;
25
            autoCheck.Checked 
= check;
26
            
27
            
string xmlPath = @"C:\Program Files\Exam\AutoUpdater.xml";
28
            
if (!File.Exists(xmlPath))
29
                
return;
30
            XmlDocument xml 
= new XmlDocument();
31
            xml.Load(xmlPath);
32
            XmlNode xmlRoot 
= xml.DocumentElement;
33
            XmlNodeList IPNodeList 
= xmlRoot.SelectNodes("UpdateServer");
34
            
string IP = IPNodeList[0].Attributes["IP"].InnerText;
35
            XmlNodeList DirNodeList 
= xmlRoot.SelectNodes("UpdateFileDir");
36
            
string Dir = DirNodeList[0].Attributes["Dir"].InnerText;
37
            txtUpdateServer.Text 
= IP;
38
            txtFileDir.Text 
= Dir;
39

40
        }

修改app.config配置

 

按 Ctrl+C 復(fù)制代碼
按 Ctrl+C 復(fù)制代碼
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
用XML文件保存配置信息的一個(gè)類(C#)
WCF修改App.config配置文件技巧分享 - 51CTO.COM
用C#一步步寫串口通信
c# XML操作
c#對(duì)xml的簡(jiǎn)單操作
xml增刪改查
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服