資源簡介
WCF中間件是用結合netTcpBinding 并以windows 服務的方式向winForm 或WebFrom客戶端提供調用。
代碼片段和文件信息
using?System;
using?System.Collections;
using?System.ComponentModel;
using?System.Configuration.Install;
using?System.IO;
using?System.Reflection;
using?System.Data;
using?System.xml;
using?System.Diagnostics;
namespace?DatabaseInstall
{
????///?
????///?Summary?description?for?ConfigHiberNate.
????///?
????public?class?ConfigHiberNate
????{
????????public?ConfigHiberNate()
????????{
????????????//
????????????//?TODO:?Add?constructor?logic?here
????????????//
????????}
????????///?
????????///?Config?Hibernate.config.xml?
????????///?
????????///?
????????public?void?ConfigHiberNateFile(string?strHibernateDir
?????????string?strServer
?????????string?strDBName
?????????string?strUser
?????????string?strPwd)
????????{
????????????try
????????????{
????????????????FileInfo?fileInfo?=?new?FileInfo(strHibernateDir?+?“\\bin\\hibernate.cfg.xml“);
????????????????if?(!fileInfo.Exists)
????????????????????throw?new?InstallException(“Cann‘t?find?config?files!“);
????????????????xmlDocument?doc?=?new?xmlDocument();
????????????????doc.Load(fileInfo.FullName);
????????????????bool?foundIt?=?false;
????????????????foreach?(xmlNode?node?in?doc[“hibernate-configuration“][“session-factory“])
????????????????{
????????????????????if?(node.Name?==?“property“)
????????????????????{
????????????????????????if?(node.Attributes.GetNamedItem(“name“).Value?==?“connection.connection_string“)
????????????????????????{
????????????????????????????node.InnerText?=?String.Format(“Server={0};initial?catalog={1};User?ID={2};Password={3};Min?Pool?Size=2“
?????????????????????????????strServer?strDBName?strUser?strPwd);
????????????????????????????foundIt?=?true;
????????????????????????}
????????????????????}
????????????????}
????????????????if?(!foundIt)
????????????????{
????????????????????throw?new?InstallException(“hinernate.config.xml?file?not?contain?property“);
????????????????}
????????????????doc.Save(fileInfo.FullName);
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????throw?ex;
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????8704??2013-01-25?13:42??DataCenter\Databa
?????文件??????24064??2013-01-25?13:42??DataCenter\Databa
?????文件???????2327??2010-06-28?09:09??DataCenter\Databa
?????文件???????2848??2010-06-28?09:09??DataCenter\Databa
?????文件???????4641??2010-06-28?11:25??DataCenter\Databa
?????文件???????1052??2010-06-09?15:18??DataCenter\Databa
?????文件???????1022??2013-01-25?13:42??DataCenter\Databa
?????文件???????8704??2013-01-25?13:42??DataCenter\Databa
?????文件??????24064??2013-01-25?13:42??DataCenter\Databa
?????文件???????1378??2010-06-09?15:18??DataCenter\Databa
?????文件????????122??2010-04-17?17:22??DataCenter\HZServer\app.config
?????文件????3407872??2010-06-09?14:34??DataCenter\HZServer\bin\Debug\Data\JXCDB_Data.MDF
?????文件???12648448??2010-06-09?14:34??DataCenter\HZServer\bin\Debug\Data\JXCDB_Log.LDF
?????文件??????39424??2018-11-09?16:57??DataCenter\HZServer\bin\Debug\HZServer.exe
?????文件????????122??2010-04-17?17:22??DataCenter\HZServer\bin\Debug\HZServer.exe.config
?????文件??????34304??2018-11-09?16:57??DataCenter\HZServer\bin\Debug\HZServer.pdb
?????文件?????421888??2008-07-31?13:31??DataCenter\HZServer\bin\Debug\Microsoft.Data.ConnectionUI.Dialog.dll
?????文件???????6656??2008-07-31?13:31??DataCenter\HZServer\bin\Debug\Microsoft.Data.ConnectionUI.dll
?????文件???????6631??2007-10-10?22:47??DataCenter\HZServer\bin\Debug\Microsoft.Data.ConnectionUI.xm
?????文件?????266240??2008-07-31?13:31??DataCenter\HZServer\bin\Debug\zh-CHS\Microsoft.Data.ConnectionUI.Dialog.resources.dll
?????文件????3407872??2010-06-09?14:34??DataCenter\HZServer\Data\JXCDB_Data.MDF
?????文件???12648448??2010-06-09?14:34??DataCenter\HZServer\Data\JXCDB_Log.LDF
?????文件???????5694??2011-10-08?10:26??DataCenter\HZServer\HZServer.csproj
?????文件????????168??2010-04-19?13:58??DataCenter\HZServer\HZServer.csproj.user
?????文件???????6990??2010-06-28?08:38??DataCenter\HZServer\Mainfrm.cs
?????文件???????9422??2010-04-19?14:48??DataCenter\HZServer\Mainfrm.Designer.cs
?????文件???????9776??2010-04-19?14:48??DataCenter\HZServer\Mainfrm.resx
?????文件???????7958??2018-11-09?16:57??DataCenter\HZServer\obj\Debug\HZServer.csproj.FileListAbsolute.txt
?????文件????????885??2013-01-25?13:43??DataCenter\HZServer\obj\Debug\HZServer.csproj.GenerateResource.Cache
?????文件??????39424??2018-11-09?16:57??DataCenter\HZServer\obj\Debug\HZServer.exe
............此處省略142個文件信息
- 上一篇:c#實現web網上商城
- 下一篇:拍拍貸數據資源,風控算法大賽的數據
評論
共有 條評論