`

OfficePage封装代码

阅读更多

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text.RegularExpressions;
using System.Data.SqlClient;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.IO;
using System.Data.SqlClient;
namespace domain.BLL
{

    public class ShowOfficePage: ShowPage
    {

        private UserInfo _userInfo; 
        private string _JSMessage;
        private string _JSScript;
        public string JSMessage {
            set { this._JSMessage = value; }
            get { return this._JSMessage; }

        }
        public string JSScript {
            set { this._JSScript = value; }
            get { return this._JSScript; }
        }
        public UserInfo UserInfo
        {
            set
            {
                _userInfo = value;
               HttpContext.Current.Response.Cookies["officeUsers"]["C_ID"]=_userInfo.C_ID;
               HttpContext.Current.Response.Cookies["officeUsers"]["CompanyName"]=Server.UrlEncode(_userInfo.C_Name);
               HttpContext.Current.Response.Cookies["officeUsers"]["C_GradeID"]=_userInfo.C_GradeID;
               HttpContext.Current.Response.Cookies["officeUsers"]["userName"]=_userInfo.UserName;
               HttpContext.Current.Response.Cookies["officeUsers"].Expires = DateTime.Now.AddDays(1);
               
            }
            get
            {
                try
                {
                    if (_userInfo == null)
                    {
                        _userInfo = new UserInfo();
                        _userInfo.C_ID = Convert.ToString(HttpContext.Current.Request.Cookies["officeUsers"]["C_ID"] ?? "");
                        _userInfo.C_Name = Server.UrlDecode(Convert.ToString(HttpContext.Current.Request.Cookies["officeUsers"]["CompanyName"] ?? ""));
                        _userInfo.C_GradeID = Convert.ToString(HttpContext.Current.Request.Cookies["officeUsers"]["C_GradeID"] ?? "");
                        _userInfo.UserName = Convert.ToString(HttpContext.Current.Request.Cookies["officeUsers"]["userName"] ?? "");
                        this._userInfo = _userInfo;
                    }
               
                }
                catch
                {
                    _userInfo = new UserInfo();
                    _userInfo.C_ID = "";
                    _userInfo.C_Name = "";
                    _userInfo.C_GradeID = "";
                    _userInfo.UserName = "";
                    this._userInfo = _userInfo;

                }
                return _userInfo;
            }
        }
        private Dictionary<string, string> dic = new Dictionary<string, string>();
        public string this[string key]
        {
            set{
                if (dic.ContainsKey(key))
                {
                    dic[key] = value;
                }
                else
                {
                    dic.Add(key,value);
                }
            }
            get{
                if (dic.ContainsKey(key))
                {
                    return dic[key];
                }
                else
                {
                    return "";
                }
            }
        }
        public ShowOfficePage()
        {
            //if (IsNotLogin())
            //{
            //    HttpContext.Current.Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["OfficeLoginPage"].ToLower());
            //}
        }
        public string GetSqlFile(FileUpload fp, int width, int height)
        {
            string sqlfile = "";
            string tempSqlPath = "";
            string path = HttpContext.Current.Request.PhysicalApplicationPath.ToString() + "upload/";
            path += "UploadFile/" + DateTime.Now.ToString("yyyyMM");
            tempSqlPath = "\\upload\\UploadFile\\" + DateTime.Now.ToString("yyyyMM");
            if (Directory.Exists(path))
            {

            }
            else
            {
                Directory.CreateDirectory(path);
            }
            if (Directory.Exists(path + "/small"))
            {
            }
            else
            {
                Directory.CreateDirectory(path + "/small");
            }
            if (Directory.Exists(path + "/temp"))
            {
            }
            else
            {
                Directory.CreateDirectory(path + "/temp");
            }
            //HttpFileCollection files = HttpContext.Current.Request.Files;

            if (fp.FileName.ToString().Length > 0)
            {
                string filename = fp.FileName.ToString();
                string datestr = DateTime.Now.ToString("yyyyMMddHmmssfff");
                string ext = filename.Substring(filename.LastIndexOf(".")).ToLower();
                if (ext != ".bmp" && ext != ".jpg" && ext != ".gif" && ext != ".jpeg")
                {
                    HttpContext.Current.Response.Write("<script>alert('上传的文件不是.gif,jpg,jpeg,bmp格式')</script>");
                    return "";
                }
                string tempFilePath = path + "/" + "temp/" + datestr + ext;
                fp.SaveAs(tempFilePath);
                #region 生成小图
                string originalFilename = path + "/" + datestr + ext;
               //fp.FileBytes
                //缩小的倍数
                int iScale = 1;
                //从文件取得图片对象
                System.Drawing.Image image = null;
                try
                {
                    image = System.Drawing.Image.FromFile(tempFilePath);
                   
                }
                catch
                {
                    //
                    try
                    {
                        File.Delete(tempFilePath);
                        image.Dispose();

                    }
                    catch
                    {
                    }
                    HttpContext.Current.Response.Write("<script>alert('上传的文件不是.gif,jpg,jpeg,bmp图片的标准格式格式')</script>");
                    return "";

                }
                int hi = 0;
                int wi = 0;
                wi = width;
                hi = height;
                Size size = new Size(wi, hi);
                //新建一个bmp图片
                System.Drawing.Image bitmap = new Bitmap(size.Width, size.Height);
                //新建一个画板
                Graphics g = Graphics.FromImage(bitmap);
                //设置高质量插值法
                g.InterpolationMode = InterpolationMode.High;
                //设置高质量,低速度呈现平滑程度
                g.SmoothingMode = SmoothingMode.HighQuality;
                //清空一下画布
                g.Clear(Color.Blue);
                //在指定位置画图
                g.DrawImage(image, new Rectangle(0, 0, bitmap.Width, bitmap.Height), new Rectangle(0, 0, image.Width, image.Height), GraphicsUnit.Pixel);
                if (ext == ".jpg" || ext == ".jpeg")
                    bitmap.Save(path + "/small/" + datestr + ext, ImageFormat.Jpeg);
                if (ext == ".gif")
                    bitmap.Save(path + "/small/" + datestr + ext, ImageFormat.Gif);
                if (ext == ".bmp")
                    bitmap.Save(path + "/small/" + datestr + ext, ImageFormat.Bmp);
                ///大图片
                if (fp.FileBytes.Length > 300000){
                  //image.Width
                   // image.Height


                    wi = 800;

                    hi = Convert.ToInt32(image.Height * (Convert.ToDouble(wi) / Convert.ToDouble(image.Width)));                
                     size = new Size(wi, hi);
                    //新建一个bmp图片
                  bitmap = new Bitmap(size.Width, size.Height);
                    //新建一个画板
                    g = Graphics.FromImage(bitmap);
                    //设置高质量插值法
                    g.InterpolationMode = InterpolationMode.High;
                    //设置高质量,低速度呈现平滑程度
                    g.SmoothingMode = SmoothingMode.HighQuality;
                    //清空一下画布
                    g.Clear(Color.Blue);
                    //在指定位置画图
                    g.DrawImage(image, new Rectangle(0, 0, bitmap.Width, bitmap.Height), new Rectangle(0, 0, image.Width, image.Height), GraphicsUnit.Pixel);
                    if (ext == ".jpg" || ext == ".jpeg")
                        bitmap.Save(originalFilename, ImageFormat.Jpeg);
                    if (ext == ".gif")
                        bitmap.Save(originalFilename, ImageFormat.Gif);
                    if (ext == ".bmp")
                        bitmap.Save(originalFilename, ImageFormat.Bmp);

                }
                else {
                    fp.SaveAs(originalFilename);
                }
                image.Dispose();
                bitmap.Dispose();
                g.Dispose();
                #endregion
                sqlfile = datestr + ext;

                try
                {
                    image.Dispose();
                    bitmap.Dispose();
                    g.Dispose();
                    File.Delete(tempFilePath);
                }
                catch (Exception ex)
                {
                    string exc = ex.Message.ToString();
                    HttpContext.Current.Response.Write("<script>alert('" + exc + "');</script>");
                }
            }
            else
            {
                sqlfile = "";
            }
            sqlfile = sqlfile.Length>0?(tempSqlPath + "\\" + sqlfile):("");
            return sqlfile;
        }
        public string GetSqlFile(FileUpload fp,string pathFile, int width, int height)
        {
            string sqlfile = "";
            string tempSqlPath = "";
            string path = HttpContext.Current.Request.PhysicalApplicationPath.ToString() + "upload/";
            path +=  pathFile;
            tempSqlPath = "\\upload\\" + pathFile;
            if (Directory.Exists(path))
            {

            }
            else
            {
                Directory.CreateDirectory(path);
            }
            if (Directory.Exists(path + "/small"))
            {
            }
            else
            {
                Directory.CreateDirectory(path + "/small");
            }
            if (Directory.Exists(path + "/temp"))
            {
            }
            else
            {
                Directory.CreateDirectory(path + "/temp");
            }
            //HttpFileCollection files = HttpContext.Current.Request.Files;

            if (fp.FileName.ToString().Length > 0)
            {
                string filename = fp.FileName.ToString();
                string datestr = DateTime.Now.ToString("yyyyMMddHmmssfff");
                string ext = filename.Substring(filename.LastIndexOf(".")).ToLower();
                if (ext != ".bmp" && ext != ".jpg" && ext != ".gif" && ext != ".jpeg")
                {
                    HttpContext.Current.Response.Write("<script>alert('上传的文件不是.gif,jpg,jpeg,bmp格式')</script>");
                    return "";
                }
                string tempFilePath = path + "/" + "temp/" + datestr + ext;
                fp.SaveAs(tempFilePath);
                #region 生成小图
                string originalFilename = path + "/" + datestr + ext;
                //fp.FileBytes
                //缩小的倍数
                int iScale = 1;
                //从文件取得图片对象
                System.Drawing.Image image = null;
                try
                {
                    image = System.Drawing.Image.FromFile(tempFilePath);

                }
                catch
                {
                    //
                    try
                    {
                        File.Delete(tempFilePath);
                        image.Dispose();

                    }
                    catch
                    {
                    }
                    HttpContext.Current.Response.Write("<script>alert('上传的文件不是.gif,jpg,jpeg,bmp图片的标准格式格式')</script>");
                    return "";

                }
                int hi = 0;
                int wi = 0;
                wi = width;
                hi = height;
                Size size = new Size(wi, hi);
                //新建一个bmp图片
                System.Drawing.Image bitmap = new Bitmap(size.Width, size.Height);
                //新建一个画板
                Graphics g = Graphics.FromImage(bitmap);
                //设置高质量插值法
                g.InterpolationMode = InterpolationMode.High;
                //设置高质量,低速度呈现平滑程度
                g.SmoothingMode = SmoothingMode.HighQuality;
                //清空一下画布
                g.Clear(Color.Blue);
                //在指定位置画图
                g.DrawImage(image, new Rectangle(0, 0, bitmap.Width, bitmap.Height), new Rectangle(0, 0, image.Width, image.Height), GraphicsUnit.Pixel);
                if (ext == ".jpg" || ext == ".jpeg")
                    bitmap.Save(path + "/small/" + datestr + ext, ImageFormat.Jpeg);
                if (ext == ".gif")
                    bitmap.Save(path + "/small/" + datestr + ext, ImageFormat.Gif);
                if (ext == ".bmp")
                    bitmap.Save(path + "/small/" + datestr + ext, ImageFormat.Bmp);
                ///大图片
                if (fp.FileBytes.Length > 300000)
                {
                    //image.Width
                    // image.Height


                    wi = 800;

                    hi = Convert.ToInt32(image.Height * (Convert.ToDouble(wi) / Convert.ToDouble(image.Width)));
                    size = new Size(wi, hi);
                    //新建一个bmp图片
                    bitmap = new Bitmap(size.Width, size.Height);
                    //新建一个画板
                    g = Graphics.FromImage(bitmap);
                    //设置高质量插值法
                    g.InterpolationMode = InterpolationMode.High;
                    //设置高质量,低速度呈现平滑程度
                    g.SmoothingMode = SmoothingMode.HighQuality;
                    //清空一下画布
                    g.Clear(Color.Blue);
                    //在指定位置画图
                    g.DrawImage(image, new Rectangle(0, 0, bitmap.Width, bitmap.Height), new Rectangle(0, 0, image.Width, image.Height), GraphicsUnit.Pixel);
                    if (ext == ".jpg" || ext == ".jpeg")
                        bitmap.Save(originalFilename, ImageFormat.Jpeg);
                    if (ext == ".gif")
                        bitmap.Save(originalFilename, ImageFormat.Gif);
                    if (ext == ".bmp")
                        bitmap.Save(originalFilename, ImageFormat.Bmp);

                }
                else
                {
                    fp.SaveAs(originalFilename);
                }
                image.Dispose();
                bitmap.Dispose();
                g.Dispose();
                #endregion
                sqlfile = datestr + ext;

                try
                {
                    image.Dispose();
                    bitmap.Dispose();
                    g.Dispose();
                    File.Delete(tempFilePath);
                }
                catch (Exception ex)
                {
                    string exc = ex.Message.ToString();
                    HttpContext.Current.Response.Write("<script>alert('" + exc + "');</script>");
                }
            }
            else
            {
                sqlfile = "";
            }
            sqlfile = sqlfile.Length > 0 ? (tempSqlPath + "\\" + sqlfile) : ("");
            return sqlfile;
        }
        public bool IsNotLogin()
        {
            bool state = true;
            if (HttpContext.Current.Request.Url.ToString().ToLower().Contains(System.Configuration.ConfigurationManager.AppSettings["OfficeLoginPage"].ToLower()))
            {
                state = false;               
            }
            else
            {
                if (GetNotNullString(UserInfo.UserName).Length >0)
                {
                    state = false;
                }              
            }          
            return state;
        }
        public void HasNoRight()
        {
            if (this.UserInfo.C_GradeID == "1")
            {

            }
            else
            {
                HttpContext.Current.Response.Write("<script type='text/javascript'>document.location.href='Notice.aspx'</script>");

            }
         
        }
        public void BindListValues(ListControl cbl, bool isText, string values)
        {
            values = string.IsNullOrEmpty(values) ? ("") : (values);
            if (values.Length > 0)
            {
                if (isText)
                {
                    string[] tempValues = values.Split(',');
                    for (int i = 0; i < tempValues.Length; i++)
                    {
                        for (int j = 0; j < cbl.Items.Count; j++)
                        {
                            if (cbl.Items[j].Text.Trim() == tempValues[i].ToString())
                            {
                                cbl.Items[j].Selected = true;
                            }
                        }
                    }
                }
                else
                {
                    string[] tempValues = values.Split(',');
                    for (int i = 0; i < tempValues.Length; i++)
                    {
                        for (int j = 0; j < cbl.Items.Count; j++)
                        {
                            if (cbl.Items[j].Value.Trim() == tempValues[i].ToString())
                            {
                                cbl.Items[j].Selected = true;
                            }
                        }
                    }
                }

            }
            else
            {

            }
        }
        public string SelectListValues(ListControl cbl, bool isText)
        {
            StringBuilder sb = new StringBuilder();

                if (isText)
                {
               
                        for (int j = 0; j < cbl.Items.Count; j++)
                        {
                            if (cbl.Items[j].Selected) {
                                sb.Append(cbl.Items[j].Text).Append(",");
                            }
                        }
                  
                }
                else
                {
                   
                        for (int j = 0; j < cbl.Items.Count; j++)
                        {
                            if (cbl.Items[j].Selected)
                            {
                                sb.Append(cbl.Items[j].Value).Append(",");
                            }
                        }
                  
                }
                return sb.ToString().TrimEnd(',');

           
        }
        public DateTime GetDateTime(string s) {
            DateTime dt = DateTime.Now;
            DateTime.TryParse(s,out dt);
            return dt;
        }
        public DateTime GetDateTime(object s)
        {
            DateTime dt = DateTime.Now;
            DateTime.TryParse(Convert.ToString(s), out dt);
            return dt;
        }
        public int GetInt(string s)
        {
            int tempInt=0;
            int.TryParse(s, out tempInt);
            return tempInt;
        }
        public int GetInt(object s)
        {
            int tempInt = 0;
            int.TryParse(Convert.ToString(s), out tempInt);
            return tempInt;
        }
        public double GetDouble(string s)
        {
            double tempDouble = 0;
            double.TryParse(s, out tempDouble);
            return tempDouble;
        }
        public string GetNotNullString(string s)
        {
            s=string.IsNullOrEmpty(s) ? ("") : (s);
            return s;
        }
        public string GetNoHTML(string Htmlstring)
        {
            //删除脚本
            Htmlstring = Regex.Replace(Htmlstring, @"<script[^>]*?>.*?</script>", "", RegexOptions.IgnoreCase);
            //删除HTML
            Htmlstring = Regex.Replace(Htmlstring, @"<br>", "$br$", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @" ", "&nbsp;", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"<(.[^>]*)>", "", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"$br$", "<br>", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"\r\n", "<br>", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"-->", "", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"<!--.*", "", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"&(quot|#34);", "\"", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"&(amp|#38);", "&", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"&(lt|#60);", "<", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"&(gt|#62);", ">", RegexOptions.IgnoreCase);
            // Htmlstring = Regex.Replace(Htmlstring, @"&(nbsp|#160);", " ", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"&(iexcl|#161);", "\xa1", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"&(cent|#162);", "\xa2", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"&(pound|#163);", "\xa3", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"&(copy|#169);", "\xa9", RegexOptions.IgnoreCase);
            Htmlstring = Regex.Replace(Htmlstring, @"&#(\d+);", "", RegexOptions.IgnoreCase);
            Htmlstring.Replace("<", "");
            Htmlstring.Replace(">", "");
            Htmlstring.Replace("\r\n", "");
            return Htmlstring;
        }
        public void DoAction(string sql)
        {
            ArrayList al = this.GetSqls(sql);
            if (this.Db.GetTranState(al))
            {
                this.ShowMessage("操作成功!", "document.location=document.location");
            }
            else
            {
                this.ShowMessage("操作失败!", "history.go(-1)");
            }
        }
        public SqlParameter[] MakeParameters(params string[] pas)
        {
            SqlParameter[] tempPas = new SqlParameter[pas.Length/2];
            if (pas.Length % 2 == 0)
            {
                for (int i = 0; i < pas.Length / 2; i++)
                {
                    tempPas[i] = new SqlParameter(pas[i*2], pas[i*2+1]);
                }
            }
            return tempPas;
          
        }

    }
 

}


 

分享到:
评论

相关推荐

    android蓝牙封装代码

    android蓝牙封装代码

    VBA代码封装助手 快速封装

    VBA代码封装助手是一个工具,它专为简化VBA代码的编写和管理而设计,帮助用户更快速、高效地封装和组织代码。 在VBA编程中,封装是一种重要的概念,它涉及到将代码逻辑分隔到不同的模块和子程序中,以便于维护和...

    核心代码封装 核心代码封装

    核心代码封装 核心代码封装 核心代码封装 核心代码封装 核心代码封装 核心代码封装 核心代码封装 核心代码封装 核心代码封装 核心代码封装 核心代码封装 核心代码封装 核心代码封装 核心代码封装 核心代码封装

    libuv c++封装最新代码

    libuv c++封装最新代码libuv c++封装最新代码libuv c++封装最新代码libuv c++封装最新代码libuv c++封装最新代码libuv c++封装最新代码libuv c++封装最新代码libuv c++封装最新代码libuv c++封装最新代码libuv c++...

    WebService接口封装代码

    WebService接口封装代码主要涉及到的是在软件开发中使用Web服务进行数据交换和功能调用的技术。Web服务是一种基于互联网的、采用标准的XML(Extensible Markup Language)格式来描述数据,并通过SOAP(Simple Object...

    PCB元件封装代码.pdf

    本文档详细介绍了PCB(印刷电路板)元件的封装代码,这些代码是在使用Protel99等电子设计自动化(EDA)软件进行PCB设计时用于标识元件封装类型的一系列标准化代码。封装代码对于设计和制造过程至关重要,因为它们...

    破解封装代码(c#)

    破解封装代码(c#),方便快捷查看程序源代码!

    经典JS封装代码(11)

    多样化摺叠菜单,CSS圆角边框,模拟视窗,支持FF的省略符,TAB选项卡,最佳化多样式Windows,多样化的垂直菜单,多样化的连结提示效果,侧栏式折叠菜单,图形...经典的国内外优秀JAVACRIPT代码封装,有兴趣的去研究下吧

    C#中源代码封装步骤

    ### C#中源代码封装步骤 #### 一、概述 在软件开发过程中,代码封装是一种重要的编程技术,它能够帮助开发者更好地组织代码结构,提高代码的可读性和可维护性。本文将详细介绍C#中源代码封装的具体步骤,旨在帮助...

    C# 封装代码

    封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。封装。...

    封装我们的VBA代码.doc

    封装 VBA 代码 在本文中,我们将讨论如何保护 VBA 代码的安全性,以避免代码被他人浏览或窃取。我们知道,VBA 代码的保护是非常重要的,因为它直接关系到我们编写的代码的安全性和知识产权的保护。 1. VBA 代码的...

    支付宝支付封装代码

    为了简化开发者在集成支付宝支付时的工作,通常会提供封装好的代码模块,以便快速、便捷地将支付宝支付功能接入到应用程序中。本篇文章将深入探讨“支付宝支付封装代码”的相关知识点。 一、模块化依赖 "module形式...

    VBA代码封装完整示例.rar

    这个“VBA代码封装完整示例.rar”压缩包很可能包含了一系列有关如何有效封装VBA代码的教程或实例。 在VBA编程中,代码封装是一个关键概念,它涉及到将相关功能组织成独立的模块,以提高代码的可读性、可维护性和...

    xml封装代码

    在IT领域,XML接口封装是将XML处理的功能打包成一个模块,方便其他部分的代码调用和处理XML数据。 标题中的“xml封装代码”指的是将XML相关的操作进行封装,形成一个类或库,以便开发者能够更高效、更安全地处理XML...

    基于webrtc的媒体库封装代码

    【基于WebRTC的媒体库封装代码】是一种将复杂的WebRTC技术进行抽象和简化,以便开发者更方便地在自己的应用程序中集成音视频通信功能的技术实践。WebRTC(Web Real-Time Communication)是Google开源的一个实时通信...

    Excel宏代码封装实例代码.

    总之,Excel宏代码封装到DLL是一种有效的代码管理和保护策略,能帮助我们更好地组织和保护宏代码,同时提高代码的复用性。通过学习和掌握这一技术,你可以为自己的Excel应用增添更多的专业性和安全性。

    Nohttp封装,soap封装

    封装后的Nohttp可以减少开发者的代码量,提高开发效率,同时也提升了代码的可读性和可维护性。 【SOAP封装】 SOAP(Simple Object Access Protocol)是一种基于XML的协议,用于在Web服务中交换结构化和类型化的信息...

    echart的封装代码

    echart的封装代码

    帧封装实验代码Vc++适用

    本文将以一个具体的帧封装实验代码为例,深入探讨如何在Vc++环境下实现帧封装。该代码适用于学习和理解帧封装的基本原理,以及如何在实际编程中运用这些原理。 #### 实验代码分析 代码首先检查命令行参数的数量...

    Go-基于redisgo进行了封装代码量减少

    在压缩包`redigo-pack-master`中,你可以找到这个封装库的源代码,包括封装的接口定义、配置加载逻辑以及可能的示例代码。通过阅读和学习这些代码,你可以更好地理解如何在Go项目中优雅地使用和管理Redis连接,降低...

Global site tag (gtag.js) - Google Analytics