04 2017 档案
摘要:说明:通过DataAdapter或者dataset连接数据库,实现对数据增删改查操作. 以前写过一篇步步为营-23-通过GridView实现增删改 1:SqlDataAdapter DataTable实现 using System; using System.Collections.Generic;
阅读全文
摘要:说明:登录失败3次,15分钟后才能登录 using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; using
阅读全文
摘要:说明: ComboBox的使用 1:准备数据 USE [master] GO /****** Object: Database [DBProvinceCity] Script Date: 2017-04-27 09:27:48 ******/ CREATE DATABASE [DBProvinceC
阅读全文
摘要:说明:数据的导入导出功能在企业中还是比较常用的,下面先介绍txt文件的导入导出,但是企业中一般是用Excel导入导出 1 先建UI页面 2清空数据库数据 3 导入数据 4导出数据 代码 using System; using System.Collections.Generic; using Sys
阅读全文
摘要:说明 :通过连接字符串判断用户名和密码是否一致,主要想使用配置文件解决数据库连接问题 1 先建UI界面 2 代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Dat
阅读全文
摘要:说明:propertyGrid的使用 ,其中涉及到一个复制到粘贴版功能 1:先建立UI界面 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using Sy
阅读全文
摘要:与数据库进行连接交互 方法一 #region 01连接对象 //01 连接字符串 string connstr = "server=.;uid=sa;pwd=sa;database=DemoDB;"; SqlConnection conn = new SqlConnection(connstr);
阅读全文
摘要:SQL 结构化查询语言(Structured Query Language) DDL DML DCL 在此不再对其进行详细解释 1 DDL 数据库定义语言 1.1 创建数据库脚本 --DDL create drop alter --创建数据库 create database TestDB; --删除
阅读全文
摘要:说明 :无论是在练习中还是在企业中都非常常用.比如说电脑做系统,用户现场实施 1:分离附加 1.1 分离 1.2如果有连接先断掉连接 文件所处位置F:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\中找到俩个文件
阅读全文
摘要:说明: 1:直接贴码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; us
阅读全文
摘要:说明:设计模式-简单工厂(参考步步为营-09随笔),反射 1 添加窗体应用程序,做好UI界面.这里不添加按钮,按钮通过文档自动创建 2 添加用于运算的父类,但是为了实现反射,需要将其放在类库中,故先加类库ProOperation, 2.1 分析父类, 首先定义成公共抽象类,方便子类实现, 需要两个属
阅读全文
摘要:说明 :简单练习反射的基础包括获取dll中的数据,方法等 程序集之间互相调用可以通过:a添加引用,b引入命名空间,来实现.但是只能调用public修辞的方法和属性.另外还可通过程序集调用 1 创建一个控制台应用程序 2 创建一个类库,用于生成dll,注意修改属性,使其生成的路径为控制台应用程序bin
阅读全文
摘要:未能加载文件或程序集“H2F, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。试图加载格式不正确的程序。 原因分析:由于vs安装的版本(32)和系统版本(64)不一致造成 项目属性=>生成=>目标平台
阅读全文
摘要:1:按钮的三击事件可能在多个地方使用,所以设置为用户控件 using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; usi
阅读全文
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.
阅读全文
摘要:事件本质:类型安全的多播委托 1:还是以音乐播放器为例 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System
阅读全文
摘要:1:先用委托演示 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; n
阅读全文
摘要:事件本质:多播委托;多播委托本质:一个委托指向多个函数 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namesp
阅读全文
摘要:1.1 找出int数组中的最大值,我们可能会这样写 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespac
阅读全文
摘要:委托:将函数作为参数传递 例如:操作将一个字符串数组转化为一下大写,小写,转变和打印,普通方法这么写 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.
阅读全文
摘要:说明:把xml中的数据放入到数据源list中然后显示到gridview中,参考上一节内容 1 UI页面 2创建student类 public class Student { public int ID { get; set; } public string Name { get; set; } pu
阅读全文
摘要:说明:通过xml完成用户登录信息的判断 1 搭建UI页面 2 新建一个student类,类中包含以上属性 public class Student { public int ID { get; set; } public string Name { get; set; } public int Ag
阅读全文
摘要:1 增加(存在则添加,不存在则新建) //对xml的操作-- XmlDocument doc = new XmlDocument(); if (File.Exists("Person.xml")) { //如果存在,加载文档 doc.Load("Person.xml"); //获取根节点 XmlEl
阅读全文
摘要:说明:可扩展标记语言 eXtensible Markup Language--区分大小写 涉及到的知识点:DOM 文档对象模型 文本文件存储数据缺点:1,不易读取.2,易乱码 1 通过代码创建一个xml文档 using System; using System.Collections.Generic
阅读全文
摘要:说明:现在我想查看博客园中,我都写了哪些随笔,都是什么时间写的.做一个数据的采集分析 using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; usi
阅读全文
摘要:说明:一个工具Regulator需要用到 一:正则表达式 1 what & why 1.1 啥是正则? 匹配字符串的规则。 1.2 为什么要用正则? 可以通过正则用来判断、寻找相应的字符串。例如:表单验证,判断是不是手机号、爬虫,从网页中爬取相应信息。 2 基本语法 1 元字符 . 匹配任意单个字符
阅读全文
摘要:以前使用的File是操作小的文本文件,用的并不常见,FileStream(操作字节),可以操作所有格式的文件,用途较广泛 下面做一个通过文件流给文件加密解密的小软件. using System; using System.Collections.Generic; using System.Compo
阅读全文
摘要:说明:涉及到知识点:TreeView控件,递归调用, 1 先把架子搭起来 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Draw
阅读全文
摘要:上一篇简单介绍了File文本文件的操作,这次简单介绍Directory的操作 Directory主要用于操作文件夹 常用方法 CreateDirectory;创建一个新的文件夹 Delete;删除文件夹 Move; 剪切文件夹 Exist;判断指定文件夹是否存在 具体应用 if(!Directory
阅读全文
摘要:1 对文件的操作-File类 常用的操作: File.Exis();判断文件是否存在 File.Create ();创建 File.Move();剪切 File.Copy();复制 File.Delete();删除 using System; using System.Collections.Gen
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 日期的转换 { //2012-12-21 //2
阅读全文
摘要:说明:https://pan.baidu.com/s/1nvPqhDJ所需文件在此目录下对应的位置 1 先做一个简单的英汉翻译词典.先搭UI页面 2 将百度网盘中提供的资料放置到bin\debug目录下 3 编写代码 using System; using System.Collections.Ge
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 集合简单练习 { class Program {
阅读全文
摘要:using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 字符串的简单练
阅读全文
摘要:先把整体UI建好 1 分析需要个计算的基类,一个构造函数,两个属性,一个方法 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Ta
阅读全文
摘要:一以贯之 :把子类看作父类,统一看待 假设用户输入一个电脑品牌,判断该品牌是否存在 1 定义一个抽象"电脑类" using System; using System.Collections.Generic; using System.Linq; using System.Text; using Sy
阅读全文
摘要:下面主要学习一下单例设计模式 首先,先看一个现象,当用户点击"登录"按钮,会弹出"登录对话框",但是当用户多次点击时,会new很多对话框.所以我们需要对代码进行改造 1.1 构造函数私有化 private Login() 1.2 声明静态字段 public static Login _single;
阅读全文
摘要:索引器-经常用,但不常写,仅作为知识点了解一下 1:定义Person类,类中定义一个数组字段 2:为了方便外部访问,封装为属性 int[] numbers = new int[5]; public int[] Numbers { get { return numbers; } set { numbe
阅读全文
摘要:说明:涉及知识点:winform窗体, 1 首先大致的UI页面做好 2 面向对象分析 需要三个对象(电脑,玩家,裁判), 对象对应方法(出拳,出拳,判断) 2.1 首先定义电脑; 电脑随机出拳,使用到随机方法.其次要把随机数转化成具体出拳内容,通过属性值显示个UI using System; usi
阅读全文
摘要:说明:涉及到继承,抽象类,虚方法,接口等知识点 鸟类都有翅膀, 鸟类都会吃,但吃的食物不一样 鸟类都会叫,虽然叫声不一样,喜鹊,燕子,麻雀,感觉都是叽叽喳喳的.程序员中的世界就是讲儿. 鸟类中,麻雀会飞,喜鹊会飞和鸵鸟不会飞 鸟类中,麻雀,喜鹊都是"叽叽喳喳"的叫,鸵鸟"哦哦"(当然我没有听过,也懒
阅读全文
摘要:说明:相信大家都知道一个经典的案例.关于电脑对不同的设备进行读取. 1 定义一个基类(移动存储设备类)其中包括两个虚方法 using System; using System.Collections.Generic; using System.Linq; using System.Text; usi
阅读全文
摘要:面向对象三大特征:封装.继承.多态.下面简单介绍一下多态的实现. 把不同的子类对象都当作父类来看,可以屏蔽不同子类对象之间的差异,写出通用的代码,做出通用的编程,以适应需求的不断变化. 实现多态的方法:1 通过虚方法;2 通过抽象方法;3 通过接口 天地生人,有一人当有一人之业,现实生活中每个人都已
阅读全文
摘要:1: 快速添加引用 Shift+Alt+F10; 也可用于实现抽象类 2: 直接添加属性 prop+Tab+Tab; 3: 根据字段添加属性 Ctrl +r+e; 4: 格式化代码 Ctrl+k+f 5: 查看方法重载 Ctrl +Shift+space //注意光标必须放在括号中 打出( 然后通过
阅读全文
摘要:知识点:1,简单工厂设计模式;2,进程使用 1.1 建立一个控制台测试程序 1.2 main方法中获得两个参数 文件路径(FilePath)和文件名(FileName) static void Main(string[] args) { Console.WriteLine("请输入文件路径"); s
阅读全文
摘要:WCF Windows Communication Foundation 1.1 新建一个"空白解决方案" 1.2 在解决方案中添加类库IBLL 1.2.1 添加接口IUserInfoService using System; using System.Collections.Generic; us
阅读全文
摘要:WebService-面向服务编程SOA WebService-远程通信 运行效果: 1:添加服务器引用http://www.webxml.com.cn/WebServices/WeatherWebService.asmx 添加表格 <?xml version="1.0" encoding="utf
阅读全文
摘要:WebService,可实现不同机器上的不同应用之间进行的通信 1.1 添加新建项Web服务 1.2 新建一个Web应用程序 1.2.1 添加服务器应用=>发现 1.2.2 添加新的窗体页面 运行结果:
阅读全文
摘要:前面已经简单介绍了Lucene.Net,下面来看一个实际的例子 1.1 引用必要的bll文件.这里不再介绍(Lucene.Net PanGu PanGu.HightLight PanGu.Lucene.Analyzer) 1.2 添加字典Dict,并设置到bin/debug目录下 1.3 创建Win
阅读全文
摘要:“System.IO.DirectoryNotFoundException”类型的未经处理的异常在 mscorlib.dll 中发生 其他信息: 未能找到路径“F:\Users\home\Documents\Visual Studio 2013\BBFJ.OA\BBFJ.OA\BFFJ.Lucene
阅读全文
摘要:说明:Lucene.Net 只是一个全文检索开发包 .查询数据的时候从Lucene.Net查询数据.可以看做是一个提供了全文检索功能的数据库. 注意:只能搜索文本字符串. 重要概念:分词,基于词库的分词算法.(庖丁解牛,盘古分词) 1.1 添加一个窗体应用程序 1.2 添加引用-https://pa
阅读全文
摘要:通过监视可以看到: 原来是跳转到登录页面后,登录页面中又发送了一个GeMneuItems的请求,用于加载页面图片
阅读全文
摘要:List<RoleInfo> roleInfoList = (List<RoleInfo>)ViewBag.AllRoles; 错误原因很明确了 ViewBag.AllRoles = RoleInfoService.LoadEntities(r=>r.DelFlag == DelFlag);改为 V
阅读全文
摘要:未将对象引用设置到对象实例,又名空指针异常,伴随程序员开发的一生. 查看详细信息得知: SetUserRoleInfo() 首先想到的是 IBLL.IRoleInfoService RoleInfoService { set; get; }应该是config文件中反射出现了问题 <?xml vers
阅读全文