• 大小: 24.79MB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2023-07-15
  • 语言: C#
  • 标签: C#  Wechat  接口  

资源简介

开发环境:VS2013及以上 开发语言 :C# 应用框架 :asp.net 适用对象: 1,企业:建设自己的企业,微信公众号接口系统 2,技术人员或站长:用来给客户做微信公众号接口系统 3,建站初学者:用作练习代码,是很好的学习材料 4,学生:作为学习微信公众号接口系统的样例程序 5,网络爱好者:当做微信公众号接口系统建设的练手工具

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
using com.index.classes.General;
using System.Web;
using com.index.classes.ErrorHandle;

namespace com.index.classes.DB
{
    public class ConnectionPool
    {
        // Fields
        public SqlConnection connection;
        private string connectionString;

        // Methods
        public ConnectionPool()
        {
            this.Init();
        }

        public ConnectionPool(string connStr)
        {
            this.connectionString = connStr;
            this.Init();
        }

        public void closeConn()
        {
            if ((this.connection.State != ConnectionState.Broken) | (this.connection.State != ConnectionState.Closed))
            {
                this.connection.Close();
            }
        }

        public void createConn()
        {
            if ((this.connection.State == ConnectionState.Broken) | (this.connection.State == ConnectionState.Closed))
            {
                this.connection.Open();
            }
        }

        public void getConnectionString()
        {
            _General general = null;
       
              general = (_General)HttpContext.Current.Application[“_general“];
            this.connectionString = ConfigurationManager.AppSettings[“connectionStringLocalDummy“];
            this.connectionString = general.DecryptText(this.connectionString);
        }

        public void getConnectionString(string strConn)
        {
            _General general = null;
            general = (_General)HttpContext.Current.Application[“_general“];
            this.connectionString = ConfigurationManager.AppSettings[strConn];
            this.connectionString = general.DecryptText(this.connectionString);
        }

        public void getMaxNoConn()
        {
        }

        private void Init()
        {
            try
            {
                if (string.IsNullOrEmpty(this.connectionString))
                {
                    this.getConnectionString();
                }
                this.connection = new SqlConnection(this.connectionString);
                this.createConn();
                this.closeConn();
            }
            catch (Exception exception)
            {
                new ShowError(exception.ToString());
            }
        }


        // Get new connection
        public SqlConnection getConnection()
        {
            return new SqlConnection(connectionString);
            //return this.connection;
        }

        public void openSpecifyConn(SqlConnection sqlConn)
        {
            if (sqlConn != null)
            {
                if (sqlConn.State == ConnectionState.Broken | sqlConn.State == ConnectionState.Closed)
                {
                    sqlConn.Open();
               

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件         79  2016-01-03 21:24  接口\.gitignore

     文件      84908  2016-01-03 21:24  接口\.vs\config\applicationhost.config

     文件      33280  2016-11-08 21:38  接口\com.index.classes\bin\Debug\com.index.classes.dll

     文件     128512  2016-11-08 21:38  接口\com.index.classes\bin\Debug\com.index.classes.pdb

     文件      30720  2016-03-03 12:48  接口\com.index.classes\bin\Release\com.index.classes.dll

     文件     103936  2016-03-03 12:48  接口\com.index.classes\bin\Release\com.index.classes.pdb

     文件       4756  2013-10-16 14:20  接口\com.index.classes\com.index.classes.csproj

     文件        257  2012-11-22 14:24  接口\com.index.classes\com.index.classes.csproj.vspscc

     文件       3047  2012-01-05 16:02  接口\com.index.classes\DB\ConnectionPool.cs

     文件       2181  2011-03-21 14:04  接口\com.index.classes\DB\ConnectionPoolOra.cs

     文件       3037  2011-03-21 14:04  接口\com.index.classes\DB\ConnectionPool_Dummy.cs

     文件      16750  2013-10-16 16:54  接口\com.index.classes\DB\SearchDataSet.cs

     文件       7416  2011-03-21 14:04  接口\com.index.classes\DB\SearchDataSet2.cs

     文件      13955  2011-03-21 14:04  接口\com.index.classes\DB\SearchDataSetOra.cs

     文件       5237  2011-03-21 14:04  接口\com.index.classes\DB\SearchDataSetOracle2.cs

    ..A.SHR       338  2012-03-26 10:24  接口\com.index.classes\DB\vssver2.scc

     文件       4517  2012-04-23 08:39  接口\com.index.classes\ErrorHandle\ShowError.cs

    ..A.SHR       122  2012-04-23 08:39  接口\com.index.classes\ErrorHandle\vssver2.scc

     文件       1947  2011-03-21 14:04  接口\com.index.classes\General\App_General.cs

     文件       2797  2011-03-21 14:04  接口\com.index.classes\General\Logic_General.cs

     文件       1212  2011-03-21 14:04  接口\com.index.classes\General\Session_General.cs

     文件        800  2011-03-21 14:04  接口\com.index.classes\General\Validators.cs

    ..A.SHR       333  2011-03-21 14:04  接口\com.index.classes\General\vssver2.scc

     文件        256  2011-03-21 14:04  接口\com.index.classes\General\_Application.cs

     文件       8923  2011-03-21 14:04  接口\com.index.classes\General\_General.cs

     文件       3718  2011-03-21 14:04  接口\com.index.classes\General\_Office.cs

     文件       1001  2011-03-21 14:04  接口\com.index.classes\General\_Session.cs

     文件        189  2012-07-27 10:03  接口\com.index.classes\mssccprj.scc

     文件       8281  2016-11-08 21:38  接口\com.index.classes\obj\Debug\com.index.classes.csproj.FileListAbsolute.txt

     文件       5464  2016-03-04 12:57  接口\com.index.classes\obj\Debug\com.index.classes.csprojResolveAssemblyReference.cache

............此处省略2660个文件信息

评论

共有 条评论