摘要: 复制:private void button1_Click(object sender, System.EventArgs e) { // Takes the selected text from a text box and puts it on the clipboard. if(textBox1.SelectedText != ”") Clipboard.SetDataObject(textBox1.SelectedText); }粘贴:private void button2_Click(object sender, System.EventArgs e) { // Decl 阅读全文
posted @ 2011-03-15 15:20 许明吉博客 阅读(385) 评论(0) 推荐(0) 编辑
摘要: C#合并数组 private static char[] Str = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v' 阅读全文
posted @ 2011-03-15 11:41 许明吉博客 阅读(953) 评论(0) 推荐(0) 编辑
摘要: protected void Page_Load(object sender, EventArgs e) { string s1 = "今天天气很晴朗很晴朗";//原始字符串 string split = "晴朗";//要合并的 int i = s1.IndexOf(split);//获取第一索引个要合并字符串的 s1=s1.Replace(split, "");//替换为空 s1 = s1.Insert(i, split);//在一个处插入合并字符串 Page.RegisterStartupScript("", 阅读全文
posted @ 2011-03-15 11:36 许明吉博客 阅读(20932) 评论(0) 推荐(1) 编辑
摘要: string[] hidenumber = HiddenField1.Value.Split(','); string[] phonenumber = txtPhoneNum.Text.Trim().Split('\r'); string[] moble = new string[hidenumber.Length + phonenumber.Length]; int index = 0; for (int i = 0; i < hidenumber.Length; i++) { moble[index] = hidenumber[i]; index++; 阅读全文
posted @ 2011-03-15 10:24 许明吉博客 阅读(6520) 评论(0) 推荐(0) 编辑
摘要: 01.byte[] head = new byte[] { 0x7e }; 02.byte[] type = new byte[] { 0x00 }; 03.byte[] content = Encoding.Default.GetBytes("ABCDEGF"); 04.byte[] last = new byte[] { 0x23 }; 05.byte[] full=new byte[head.Length+type.Length+content.Length+last.Length]; 06.//head.CopyTo(full,0); 07.//type.CopyT 阅读全文
posted @ 2011-03-15 10:23 许明吉博客 阅读(21869) 评论(1) 推荐(1) 编辑
摘要: 上一篇的解决办法显然不是最优的,先在找到了一种最优的解决办法,利用Directory进行合并数组,去除重复项。代码如下:效果如下:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace DouHaoCount{ class Program { static void Main(string[] args) { long T1 = DateTime.Now.Ticks; Dictionary<int, int> dic = new Dictionary< 阅读全文
posted @ 2011-03-15 10:22 许明吉博客 阅读(2922) 评论(0) 推荐(0) 编辑
摘要: private static char[] constant = { '0','1','2','3','4','5','6','7','8','9', 'a','b','c','d','e','f','g','h','i','j','k','l', 阅读全文
posted @ 2011-03-15 10:04 许明吉博客 阅读(309682) 评论(8) 推荐(15) 编辑