1:封装 将对象进行封装,并不等于将整个对象完全包裹起来,而是根据实际需要,设置一定的访问权限,用户根据不同的权限调用对象提供的功能,在C#语言中,可以使用修饰符public、internal、protected、private分别修饰类的字段、属性和方法。 2:继承,主要是注意继承的格式 [csharp] view plaincopypublic class ParentClass //父类 { public ParentClass(); } public class ChildClass : ParentClass :子类 { ...
1,从soureforge下载sdk(包括汇编,c,c++,c#,java)
下载地址http://nchc.dl.sourceforge.net/project/sevenzip/LZMA%20SDK/lzma920.tar.bz22,CS文件夹就是c#实现的7zip压缩算法,但是没有封装好,不好用。在csdn上看到有人封装过。http://download.csdn.net/detail/sanguorewrite/4313133 下载下来感觉接口做的不是很好,在他的基础上我又该了下 这样调用就方便了 压缩代码//源地址,压缩后的地址SevenZipHelper.Zip("test...
参考1:关于如何使用System.Data.SQLite的入门:http://www.dreamincode.net/forums/topic/157830-using-sqlite-with-c%23/ 1using System;2using System.Collections.Generic;3using System.Data;4using System.Data.SQLite;5using System.Globalization;6using System.Linq;7using System.Windows.Forms;8 9namespace Simple_Disk_Catalog10{11publicclass SQLiteDatabase12 {13 String DBConnection;14 15privatere...
封装自定义控件很简单,没什么技术含量,这里通过封装自定义的数字文本框实例简单总结一下:【1】新建自定义控件库 -- Windows Forms Control Library【2】添加自定义组件 -- Component Class【3】继承TextBox,添加KeyPress事件,代码如下:using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespac...
page:<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ViewxxxxChartsInfo.ascx.cs" Inherits="DotNetNuke.Modules.HRAddUser.ViewxxxxChartsInfo" %><style type="text/css">.GridHead th {text-align: center;}</style>
<asp:Panel ID="panMain" runat="server"><table style="border: 1px solid #e1e0e0"><tr><td><asp:Label ID="Label3" runat="server" Text="查询范围:"></asp:Label><asp:DropDownList ID="ddlD...
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;namespace TXR.Base
{publicclass CommonResult<TValue>{public CommonResult(TValue value){this.Value = value;}public CommonResult(WarnResult value){this.WarnResult = value;}[CompilerGenerated]public TValue Value { get; }[CompilerGenerated]public WarnResult WarnResult { get; }publicstaticimplicitop...
其他不多说,直接上例子,我引用的是layer弹框的移动端插件一、页面<head>调用下面方法<script src="/js/layer.js"></script><script>function alertFn(msg) {layer.open({content: msg ,shadeClose: false,btn: [‘OK‘],yes: function () {location.href = "default.aspx?i=" + Math.random();},});}
</script> 二、后台调用方法 ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script>alertFn(‘前台弹出的...
接 C# SQL封装(一)开始操作数据库的测试 :650) this.width=650;" title="03.png" src="/upload/getfiles/default/2022/11/5/20221105091245514.jpg" />using System;using System.Collections.Generic;using System.Linq;using System.Text;using DBDome.com;using DBDome.model;using System.Data.SqlClient;using System.Data;namespace DBDome{ class Program { static void Main(string[] args) { ...
当我们写好自己的dll,如果项目引用该dll是通过“项目”-》“解决方案”引用的话,dll的注释说明会有智能提示 但是当我们通过“浏览”引用该dll时会发现没有智能提示,这时候在封装dll时,我们需要执行如下步骤来使封装的dll的智能提示起作用 注释说明文件就是生成的XML文档文件 最后其他项目使用该封装的dll时需要在自己的dll引用路径下包含该封装的dll和dll的注释说明文件(xml文件) 原文:https://www.cnblogs.com/tomorrow0/p...
using System.Data;
using System.IO;namespace DotNet.Utilities
{///<summary>/// CSV文件转换类///</summary>publicstaticclass CsvHelper{///<summary>/// 导出报表为Csv///</summary>///<param name="dt">DataTable</param>///<param name="strFilePath">物理路径</param>///<param name="tableheader">表头</param>///<param name="columname">字段标题,逗号分隔</param>publicstaticbool dt2csv(DataTable dt, string strFi...
在平时开发过程中常常需要取一个方法的返回值,BOSS写了一个返回值类,做个练习以备不时之需:返回值支持泛型和非泛型 先贴上代码:非泛型返回值类: 1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Runtime.Serialization;6 7 8namespace WindowsFormsApplication319{
10 [Serializable]
1112publicclass ReturnValue
13 {
14///<summary>15/// 状态:成功、失败
1...
C#图片处理示例(裁剪,缩放,清晰度,水印)吴剑 2011-02-20原创文章,转载必需注明出处:http://www.cnblogs.com/wu-jian/ 前言需求源自项目中的一些应用,比如相册功能,通常用户上传相片后我们都会针对该相片再生成一张缩略图,用于其它页面上的列表显示。随便看一下,大部分网站基本都是将原图等比缩放来生成缩略图。但完美主义者会发现一些问题,比如显示排版时想让相片缩略图列表非常统一、整齐、和美观,比如要求每张缩略图大小...
老师在讲C#实战项目时所使用的SqlHelper,使用的数据库时SQL Server注意,连接数据库的连接字符串需要在配置文件中设置好<appSettings><add key = "connString" value="data source = .; database = CourseSelectionInfo; integrated security = true"/>
</appSettings>public class SqLHelper
{#region 连接字符串connStringprivate static string connString;static DBHelper(){connString = ConfigurationManager.AppSettings["...
本人一直认为AS3的事件处理机制很是给力 , 今天鼓捣了出来并完美得通过了测试。在AS3中使用函数addEventListener添加事件侦听,用removeEventListener移除事件侦听。着用封装的一个类库可以彻底地终结消息传递中无规则,无规律的混乱状态,从而达到代码逻辑清晰性。改起来也相当简单(做过程序员的都懂)。关于此类库的实现原理 , 其实使用的是委托(delegate),让侦听函数(观察者)挂载到此委托上,当然消息有不同的类型,如w...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
namespace MYHelper
{//不加public,只有dal私有引用;//封装执行sql server增删改查辅助类,提供相应执行sql语句和存储过程的方法//作者:白宁超(http://www.cnblogs.com/baiboy/)static class SQLHelper{//读取配置文件中的连接字符串static string con...