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

资源简介

C#调用Codesoft打印,利用Codesoft生成一个模版,C#通过赋值并条用打印机打印

资源截图

代码片段和文件信息


using System;

namespace PatriotLab
{
    /// 
    /// dbCon 的摘要说明。
    /// 

    public class dbCon
    {
        public static Rtdmes.DBAccess.DbAccess CreateDB()
        {
            return conDb(“ADMIN“);
        }

        public static Rtdmes.DBAccess.DbAccess CreateDB(string UserNo)
        {
            return conDb(UserNo);
        }

        private static Rtdmes.DBAccess.DbAccess conDb(string UserNo)
        {
            string Database = System.Configuration.ConfigurationSettings.AppSettings[“Database“].ToString();
            string DBType = System.Configuration.ConfigurationSettings.AppSettings[“DBType“].ToString();
            string Password = System.Configuration.ConfigurationSettings.AppSettings[“Password“].ToString();
            string Server = System.Configuration.ConfigurationSettings.AppSettings[“Server“].ToString();
            string Username = System.Configuration.ConfigurationSettings.AppSettings[“Username“].ToString();

            string connectioning = ““;
            Rtdmes.framework.TagDBType dbtype = Rtdmes.framework.TagDBType.Oracle;


            switch (DBType.ToLower())
            {
                case “oracle“:
                    connectioning = “user id=“ + Username + “;data source=“ + Server + “;password=“ + Password + “;Connection Lifetime = 5;Pooling=true;Max Pool Size =100;Min Pool Size=10“;
                    dbtype = Rtdmes.framework.TagDBType.Oracle;
                    break;
                case “sqlserver“:
                    connectioning = “server=“ + Server + “;uid=“ + Username + “;pwd=“ + Password + “;database=“ + Database + “; connection reset=false; connection lifetime=5; enlist=true;Max Pool Size=100;Pooling=true“;
                    dbtype = Rtdmes.framework.TagDBType.SqlServer;
                    break;

                case “oledb“:
                    connectioning = ““;
                    dbtype = Rtdmes.framework.TagDBType.OleDB;
                    break;
            }

            Rtdmes.DBAccess.DbAccess odb = null;

            //RTDMes.framework.LoginUser login = new RTDMes.framework.LoginUser(Server Database Username Password);
            Rtdmes.framework.UserInfo login = new Rtdmes.framework.UserInfo(Server Database Username Password DBType);
            login.UserNo = “ADMIN“;
            //login.UserOrg = ““;

            odb = Rtdmes.DBAccess.DbAccess.CreateDB(connectioning dbtype);
            //odb.loginUser = login;
            odb.UserInfo = login;

            return odb;
        }

    }
}

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

     文件      45568  2009-12-12 15:42  打印系统\LUKE.Lab

     文件       3774  2009-02-05 17:35  打印系统\PrinterDemo\6SIGMA.ico

     文件        299  2010-03-28 12:03  打印系统\PrinterDemo\App.config

     文件          2  2009-02-05 10:54  打印系统\PrinterDemo\bin\Debug\20090205.txt

     文件          0  2009-02-05 10:26  打印系统\PrinterDemo\bin\Debug\200925.txt

     文件       3774  1997-09-06 14:28  打印系统\PrinterDemo\bin\Debug\6SIGMA.ico

     文件      13312  2009-02-23 09:06  打印系统\PrinterDemo\bin\Debug\AxInterop.BARCODEXLib.dll

     文件     868352  2005-12-02 20:02  打印系统\PrinterDemo\bin\Debug\barcodex.ocx

     文件      28672  2008-05-21 14:02  打印系统\PrinterDemo\bin\Debug\ClientLibrary.dll

     文件     184320  2008-05-21 14:02  打印系统\PrinterDemo\bin\Debug\ClientPBForms.dll

     文件        509  2009-02-09 16:23  打印系统\PrinterDemo\bin\Debug\Data\20090209.txt

     文件        348  2009-02-10 15:18  打印系统\PrinterDemo\bin\Debug\Data\20090210.txt

     文件        266  2009-12-12 15:57  打印系统\PrinterDemo\bin\Debug\Data\20091212.txt

     目录          0  2010-03-28 11:23  打印系统\PrinterDemo\bin\Debug\Data

     文件      69632  2008-05-21 14:02  打印系统\PrinterDemo\bin\Debug\DBAccess.dll

     文件      49152  2010-03-28 13:57  打印系统\PrinterDemo\bin\Debug\Demo.bak

     文件      24576  2010-03-28 13:57  打印系统\PrinterDemo\bin\Debug\Demo.Lab

     文件     110592  2008-05-21 14:02  打印系统\PrinterDemo\bin\Debug\framework.dll

     文件      28672  2009-02-23 09:06  打印系统\PrinterDemo\bin\Debug\Interop.BARCODEXLib.dll

     文件    1093632  2008-01-22 19:54  打印系统\PrinterDemo\bin\Debug\Interop.Excel.dll

     文件      86016  2009-02-23 09:06  打印系统\PrinterDemo\bin\Debug\Interop.LabelManager2.dll

     文件      57344  2008-01-22 19:54  打印系统\PrinterDemo\bin\Debug\Interop.VBIDE.dll

     文件        209  2010-03-30 14:17  打印系统\PrinterDemo\bin\Debug\ipConfig.xml

     文件        748  2009-12-22 09:20  打印系统\PrinterDemo\bin\Debug\LabSet.xml

     文件        622  2009-12-22 09:48  打印系统\PrinterDemo\bin\Debug\LenSet.xml

     文件         84  2009-12-16 19:04  打印系统\PrinterDemo\bin\Debug\lenUserSet.xml

     文件        156  2009-02-09 15:28  打印系统\PrinterDemo\bin\Debug\LogErr\20090209.txt

     文件        216  2009-02-10 15:16  打印系统\PrinterDemo\bin\Debug\LogErr\20090210.txt

     文件         41  2009-12-12 13:55  打印系统\PrinterDemo\bin\Debug\LogErr\20091212.txt

     目录          0  2010-03-28 11:23  打印系统\PrinterDemo\bin\Debug\LogErr

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

评论

共有 条评论

相关资源