随笔分类 -  C#.Net & MVC

摘要:using System; using System.Collections.Generic; using System.Text; using System.IO.Ports; using System.Windows.Forms; namespace TestSerialPort { /// /// 串口开发辅助类 /// public class Ser... 阅读全文
posted @ 2014-06-27 16:02 深南大道 阅读(203) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts... 阅读全文
posted @ 2014-06-26 14:17 深南大道 阅读(190) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Runt... 阅读全文
posted @ 2014-06-24 11:00 深南大道 阅读(483) 评论(0) 推荐(0) 编辑
摘要:private void button2_Click(object sender, EventArgs e) { Bitmap image = new Bitmap(200, 200); Graphics g = Graphics.FromImage(image); //使绘图质量最高,即消除锯... 阅读全文
posted @ 2014-06-12 15:49 深南大道 阅读(343) 评论(0) 推荐(1) 编辑
摘要:namespace SerialPort { public partial class Form3 : Form { delegate void UpdateTextEventHandler(string text); //委托,此为重点 public static readonly string connStr = AppHelper.Get... 阅读全文
posted @ 2014-05-27 15:29 深南大道 阅读(323) 评论(0) 推荐(0) 编辑
摘要:CREATE PROCEDURE [dbo].[GetNameById] @studentid varchar(8), @studentname nvarchar(50) OUTPUT AS BEGIN SELECT @studentname=studentname FROM student WHERE studentid=@studentid if @@Error0 RETU... 阅读全文
posted @ 2014-05-26 14:02 深南大道 阅读(331) 评论(0) 推荐(0) 编辑
摘要:<?xml version="1.0"?> <!--先引用URLRewriter.dll,放置于Bin目录--> <configuration> <configSections> <!--配置重写规则节点--> <section name="RewriterConfig" type="URLRewr 阅读全文
posted @ 2014-05-22 17:24 深南大道 阅读(164) 评论(0) 推荐(0) 编辑
摘要:/// /// 判断手机用户UserAgent /// /// private bool IsMobile() { HttpContext context = HttpContext.Current; if (context != null) { HttpRequest request = context.Request; i... 阅读全文
posted @ 2014-05-21 15:02 深南大道 阅读(194) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System. 阅读全文
posted @ 2014-05-19 09:14 深南大道 阅读(488) 评论(0) 推荐(0) 编辑
摘要:void Application_Error(object sender, EventArgs e) { // 在出现未处理的错误时运行的代码 Exception objErr = Server.GetLastError().GetBaseException(); //获取错误 string err 阅读全文
posted @ 2014-05-08 14:59 深南大道 阅读(352) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Text; using System.Runtime.InteropServices; using System.Reflection; using System.Windows.Forms; namespace MouseKeyboardLibrary { /// /// Abstract base class for ... 阅读全文
posted @ 2014-05-07 10:39 深南大道 阅读(1153) 评论(0) 推荐(0) 编辑
摘要:通常,在C#中实现串口通信,我们有四种方法: 第一:通过MSCOMM控件这是最简单的,最方便的方法。可功能上很难做到控制自如,同时这个控件并不是系统本身所带,所以还得注册,不在本文讨论范围。可以访问http://www.devhood.com/tutorials/tutorial_details.a 阅读全文
posted @ 2014-04-22 17:28 深南大道 阅读(1107) 评论(0) 推荐(0) 编辑
摘要:我们经常会遇到在Winform或是WPF中点击链接或按钮打开某个指定的网址, 或者是需要打开电脑中某个指定的硬盘分区及文件夹, 甚至是"控制面板"相关的东西, 那么如何做呢? 答案是使用System.Diagnostics.Process.Start()。它的作用是调用外部的命令。 先来看看它的调用 阅读全文
posted @ 2014-04-14 11:04 深南大道 阅读(199) 评论(0) 推荐(0) 编辑
摘要://Image转换Bitmap //1. Bitmap img = new Bitmap(imgSelect.Image); //2. Bitmap bmp = (Bitmap)pictureBox1.Image; /// <summary> /// 将图片Image转换成Byte[] /// </ 阅读全文
posted @ 2014-04-11 16:16 深南大道 阅读(255) 评论(0) 推荐(0) 编辑
摘要:#region 接口返回的Xml转换成DataSet /// <summary> /// 返回的Xml转换成DataSet /// </summary> /// <param name="text">Xml字符</param> /// <returns></returns> private Data 阅读全文
posted @ 2014-03-28 17:01 深南大道 阅读(223) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Data; using System.Drawing; namespace Code { class BarCode { public class Code128 { priva 阅读全文
posted @ 2014-03-28 12:08 深南大道 阅读(505) 评论(0) 推荐(0) 编辑
摘要:(1)自定义纸张设置 控制面板->打印机和传真->右键->服务器属性->创建新的格式 (2)自定义纸张使用 this.printDocument1.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("NewPrint", iWidth, iHeight); NewPrint:制... 阅读全文
posted @ 2014-03-27 15:06 深南大道 阅读(1637) 评论(0) 推荐(0) 编辑
摘要://write txt StringBuilder builder = new StringBuilder(); FileStream fs = new FileStream(saveFileName, FileMode.Create); StreamWriter sw = new StreamWr 阅读全文
posted @ 2014-03-27 14:47 深南大道 阅读(228) 评论(0) 推荐(0) 编辑
摘要://C# 的串口通信,是采用serialPort控件,下面是对serialPort控件(也是串口通信必备信息)的配置如下代码: serialPort1.PortName = commcomboBox1.Text; serialPort1.BaudRate = int.Parse(baudcomboBox2.Text); serialPort1.Parity = (Parity)Enum.Par... 阅读全文
posted @ 2014-03-27 14:05 深南大道 阅读(3130) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Text; namespace MacPrinter { public class ZPL_Command { /// (^EF)<summary> /// 清除设定 (已包含起 阅读全文
posted @ 2014-03-26 17:54 深南大道 阅读(820) 评论(0) 推荐(0) 编辑