导航

上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 35 下一页

2011年7月7日

摘要: 使用Sort方法,可以对集合中的元素进行排序。Sort有三种重载方法,声明代码如下所示。public void Sort();//使用集合元素的比较方式进行排序public void Sort(IComparer comparer);//使用自定义比较器进行排序public void Sort(int index, int count, IComparer comparer)//使用自定义比较器进行指定范围的排序注意:为使用Sort方法进行排序,集合中的所有元素必须实现IComparable接口,否则,将抛出异常。这里介绍使用第一种方法进行简单的排序实例using System;using S 阅读全文

posted @ 2011-07-07 13:25 beeone 阅读(48721) 评论(0) 推荐(0)

摘要: ArrayList的使用方法 1、什么是ArrayList ArrayList就是传说中的动态数组,用MSDN中的说法,就是Array的复杂版本,它提供了如下一些好处:动态的增加和减少元素 实现了ICollection和IList接口 灵活的设置数组的大小2、如何使用ArrayList 最简单的例子:ArrayList List = new ArrayList();for( int i=0;i<10;i++ ) //给数组增加10个Int元素List.Add(i); //..程序做一些处理List.RemoveAt(5);//将第6个元素移除for( int i=0;i<3;i++ 阅读全文

posted @ 2011-07-07 13:19 beeone 阅读(843) 评论(0) 推荐(0)

摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.OleDb;using Microsoft.Office.Tools.Excel;using System.Data.SqlClient;using System.Collections;namespace Test{ public partial 阅读全文

posted @ 2011-07-07 11:28 beeone 阅读(1458) 评论(0) 推荐(0)

2011年7月6日

摘要: 添加一个button1,添加一个ListBox1由于ListBox1不能对于字符串换行输出,于是,本人做了一个“循环截取的方法” #region 对字符串循环截取 /// <summary> /// 对字符串循环截取 /// </summary> /// <param name="str">被截取的字符串</param> /// <param name="Length">截取的长度</param> /// <returns></returns> private 阅读全文

posted @ 2011-07-06 16:44 beeone 阅读(1702) 评论(0) 推荐(0)

2011年7月5日

摘要: /******************************************************** * 如果引用->添加引用->.net选项卡下有->using Microsoft.Office.Interop.Excel;->直接引入 * 如果没有,请把->Microsoft.Office.Interop.Excel.dll->放到Debug目录下-> * 引用->添加引用->浏览选项卡下有->using Microsoft.Office.Interop.Excel;->直接引入 * 然后再类的上边添加usin 阅读全文

posted @ 2011-07-05 22:52 beeone 阅读(3535) 评论(0) 推荐(0)

摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.OleDb;using Microsoft.Office.Tools.Excel;using System.Data.SqlClient;using System.Collections;namespace Test{ public partial 阅读全文

posted @ 2011-07-05 13:44 beeone 阅读(2580) 评论(0) 推荐(0)

摘要: private void radioButton1_CheckedChanged(object sender, System.EventArgs e) { //设置字体为宋体 textBox1.Font=new Font("宋体",textBox1.Font.Size,textBox1.Font.Style); } private void radioButton4_CheckedChanged(object sender, System.EventArgs e) { //设置字体的大小为12 textBox1.Font=new Font(textBox1.Font.Fon 阅读全文

posted @ 2011-07-05 10:07 beeone 阅读(41567) 评论(2) 推荐(0)

摘要: #region 把数据绑定到dataGridViewX1 /// <summary> /// /// </summary> /// <param name="RiverName">河流名称</param> /// <param name="connString">数据库连接串</param> public void GetRiverString(string RiverName, string connString) { SqlConnection conn = null; try 阅读全文

posted @ 2011-07-05 10:03 beeone 阅读(883) 评论(0) 推荐(0)

摘要: #region 把字段对应的数据按照相应的有效位显示 /// <summary> /// 把字段对应的数据按照相应的有效位显示 /// </summary> /// <param name="ds">DataSet数据集</param> /// <param name="Field">字段</param> /// <param name="Format">显示格式 如:“0.00”</param> public static void Se 阅读全文

posted @ 2011-07-05 09:58 beeone 阅读(275) 评论(0) 推荐(0)

摘要: [转载]利用 IIdentifyDialog 模拟ArcMap工具里面 Identify功能进行要素查询 (2010-10-09 22:02:49) 标签: 杂谈 分类: 学习 利用 IIdentifyDialog 模拟ArcMap工具里面 Identify功能进行要素查询利用AE提供的IIdentifyDialog,创建class identifyTool 。然后在程序里面就可以在鼠标点击按钮功能下,模拟实现ArcMap工具里面 Identify功能。类生成代码如下: 1 public sealed class identifyTool : BaseTool 2 { 3 IHookHelp 阅读全文

posted @ 2011-07-05 09:57 beeone 阅读(664) 评论(0) 推荐(0)

上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 35 下一页