C#
WavesLine
这个作者很懒,什么都没留下…
展开
-
win32
using System;using System.Runtime.InteropServices;using System.Drawing;using System.Text;namespace wsWin{ public class Win32 { public const int GW_HWNDFIRST = 0; public原创 2015-02-24 17:51:33 · 662 阅读 · 0 评论 -
文件夹操作
string foldername = "."""; if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { foldername = folderBrowserDialog1.SelectedPath; }原创 2015-02-24 08:20:42 · 302 阅读 · 0 评论 -
C# 中的字体
C#中本来已经封装了通用字体Font,但是笔者认为这个Font在使用过程中很不方便。1) Font的很多属性都是只读的,不能通过更改属性的值而对Font进行操作;必须重新初始化Font对象才行。例如:font.Size=12;是不允许的。2) Font总归是用来写字的,但是C#中的Font类与string类没有什么联系,这给Font的使用带来了一些麻烦。比如我想要知道一个string对象使原创 2015-02-24 08:22:32 · 1339 阅读 · 0 评论 -
StringX
namespace wsControls{ public class StringX { public static char mylar = (char)220; #region [ Property ] String public string String { get; set; } #endregion原创 2015-02-24 17:50:31 · 805 阅读 · 0 评论 -
FileAssociation
using System;using System.Text;using System.Runtime.InteropServices;using System.Windows.Forms;using Microsoft.Win32;namespace wsWin{ #region [ FileAssociation ] public class FileAssoci原创 2015-02-24 17:53:11 · 1070 阅读 · 0 评论 -
Copy文件
private void bRun_Click(object sender, EventArgs e){ byte[] buffer; int blocksize = 4096; try { FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open);原创 2015-02-26 09:24:21 · 407 阅读 · 0 评论 -
ListView 到 Excel
using System.Reflection;Function(){ Excel.Application app = new Excel.Application(); if (app == null) { MessageBox.Show("Failed to Load Excel,Pleas原创 2015-02-24 08:19:11 · 766 阅读 · 0 评论 -
c# 后台程序
C# 中的backgroundworker,是我个人认为最具有吸引力的windows标准控件之一,他允许程序在后台运行一个独立的线程,而不影响前台主窗口。这种进程控制在操作数据库或通讯时非常实用,因为后台线程在工作时并不影响前台的任何操作。如果不使用backgroundworker而简单的应用单一线程操作,则通讯时很有可能会造成主窗口假死,知道通讯结束后才会恢复。下面简单介绍backgroundw原创 2015-02-24 08:21:17 · 771 阅读 · 0 评论 -
User Define Message
You need total 3 steps to define your message [DllImport("user32.dll")]public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wPar, IntPtr lPar); public const int UserMsg =原创 2015-02-24 08:23:24 · 508 阅读 · 0 评论 -
C# 打开外部文件
System.Diagnostics.Process.Start(".//Help.chm");原创 2015-02-24 08:20:47 · 761 阅读 · 0 评论 -
读文件
string FileName;//文件名using (StreamReader sr = new StreamReader(FileName)) { String line; string[] split = new string[300]; string header;原创 2015-02-24 08:17:21 · 416 阅读 · 0 评论 -
wsArray
using System;using System.Collections.ObjectModel;using System.Linq;using System.Text;namespace wsControls{ public class wsArray { #region [ Static ] GetFrequency, GetChanPower,原创 2015-02-24 17:55:36 · 373 阅读 · 0 评论 -
数值格式化参数收集
数值格式化参数收集, 方便于查询int a = 12345678;double b = 1234.12543; //格式为sring输出特殊样式输出Label1.Text = string.Format("asdf{0:C}",b);//asdf¥1,234.13Label1.Text = "asdfadsf"+b.ToString("C")+"adsfasdf";//asdfads转载 2015-02-24 08:18:08 · 373 阅读 · 0 评论 -
关于验证
/*---------------------- * * 使用方法 * 1) 建立新窗口 2) 使用VadTextBox 3) 设置属性: vadTextBox1.VadFormat = VadString.DateTime("-", " ", ":"); vadTextBox1.MatchSta原创 2015-02-24 08:19:37 · 358 阅读 · 0 评论 -
ini, Reg
using System.Text;using Microsoft.Win32;namespace wsWin{ #region [ *.ini file ] public class InI { public string path; public InI(string INIPath) {原创 2015-02-24 17:53:46 · 517 阅读 · 0 评论 -
CDataGrid
enum DataMask { Num, Float, Date, NvChar, Bit }; [ToolboxBitmap(typeof(System.Windows.Forms.DataGridView))] class CDataGrid : DataGridView { public DataMask val_type; publi原创 2015-02-24 08:18:23 · 781 阅读 · 0 评论 -
DataGrid导出到Ex el, 自动获取列标识
#region [ 导出到Excel ] public void Export() { #region range int count = this.Columns.Count; if (count > 256 || count == 0)//超出Excel的最大行数,原创 2015-02-24 08:20:08 · 479 阅读 · 0 评论 -
读写操作,文件和注册表
using System;using System.Collections.Generic;using System.Linq;using Microsoft.Win32;using System.Text; 读写INI文件 public class InI { public string path; #region -- Dll I原创 2015-02-24 08:29:21 · 428 阅读 · 0 评论 -
wsFile
using System;using System.Collections.ObjectModel;using System.Data;using System.Drawing;using System.IO;using System.Text;namespace wsControls.IO{ public class wsFile { publi原创 2015-02-24 17:55:00 · 443 阅读 · 0 评论 -
读写文件
BackgroundWorker background1 = new BackgroundWorker();byte[] buffer1;//HDD -> MEMBackgroundWorker background2 = new BackgroundWorker();byte[] buffer2;//MEM -> HDDUInt32 pointer1, pointer2;bool abor原创 2015-02-26 20:07:20 · 489 阅读 · 1 评论