• 大小: 13.41MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-21
  • 语言: C#
  • 标签: WCF  

资源简介

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.xm

        /// 


        /// 

        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\DatabaseInstall\bin\Debug\DatabaseInstall.dll

     文件      24064  2013-01-25 13:42  DataCenter\DatabaseInstall\bin\Debug\DatabaseInstall.pdb

     文件       2327  2010-06-28 09:09  DataCenter\DatabaseInstall\ConfigHiberNate.cs

     文件       2848  2010-06-28 09:09  DataCenter\DatabaseInstall\DatabaseInstall.csproj

     文件       4641  2010-06-28 11:25  DataCenter\DatabaseInstall\DatabaseInstaller.cs

     文件       1052  2010-06-09 15:18  DataCenter\DatabaseInstall\DatabaseInstaller.Designer.cs

     文件       1022  2013-01-25 13:42  DataCenter\DatabaseInstall\obj\Debug\DatabaseInstall.csproj.FileListAbsolute.txt

     文件       8704  2013-01-25 13:42  DataCenter\DatabaseInstall\obj\Debug\DatabaseInstall.dll

     文件      24064  2013-01-25 13:42  DataCenter\DatabaseInstall\obj\Debug\DatabaseInstall.pdb

     文件       1378  2010-06-09 15:18  DataCenter\DatabaseInstall\Properties\AssemblyInfo.cs

     文件        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.xml

     文件     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个文件信息

评论

共有 条评论