上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 17 下一页
摘要: 位操作符是对数据按二进制位进行运算的操作符。位操作是其他很多语言都支持的操作,如C、C++和Java等,C#也不例外支持位操作。注意位操作支持的数据类型是基本数据类型,如byte、short、char、int、long等,C#支持的位操作有如下几种:· 按位与 & · 按位或 | · 按位取反 ~ · 左移 << · 右移 >> · 异或^在C#中位操作同C的位操作没有什么区别,位操作的速度相对较快,而且如果熟练的话,处理起来也相对方便,特别是在一些权限等相关的设置中,比如:用1、2、4、8、16、32 阅读全文
posted @ 2013-03-29 09:46 clown 阅读(881) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Configuration; using System.Data; using System.Data.SqlClient; namespace JonseTest { public class SqlServerHelper { public static string ConnString = string.Empty; public stati... 阅读全文
posted @ 2012-12-10 22:33 clown 阅读(363) 评论(0) 推荐(0) 编辑
摘要: 【问题】:当点击列标题的时候,能够完成对该列排序,再次点击,按照该列反序排序。【解决方法】:使用 IComparer接口。例子:1.using System;using System.Collections.Generic;using System.Text;using System.Collections;using System.Windows.Forms;namespace sortListView{ class ListViewColumnSorter: IComparer { private int ColumnToSort;// 指定按照哪个列排序 priv... 阅读全文
posted @ 2012-12-09 15:40 clown 阅读(1777) 评论(0) 推荐(0) 编辑
摘要: 昨天选课,虽然有一个排队系统。但是排队系统实在不怎么的啊。插队的有那么的多。有人做了插队工具下了一个看看,那是一个使用javascript实现的系统,整个只有一个页面。你可以在这里下载:/Files/lulu/xk.rar。它使用xmlHttpRequest向服务器发送请求。 js不太熟悉,发现HttpRequest功能差不多,用它试试啦。但是不知道提交数据怎么组织,革命尚未成功但是还是学到了点东西,就在这了写下来了: //Get请求方式 private string RequestGet(string Url) { string PageStr = string.Empty;//用于存放.. 阅读全文
posted @ 2012-11-24 11:03 clown 阅读(706) 评论(0) 推荐(0) 编辑
摘要: 年底接近尾声,闲来无事,继续加强学习C#的一些基础知识,今天弄了一下Dictionary排序,顺便做个小Demo,以加深映像,为了更加真实些,稍微使逻辑复杂了一些,关键训练一下自己的思维逻辑:1.先看效果图:2.核心逻辑如下:Dictionary<int, string> list = new Dictionary<int, string>();//实例化一个字典Random rd = new Random();//为了更加真实,创建一个生成整数的随机数生成器int id = 0;List<int> idlist = new List<int>( 阅读全文
posted @ 2012-11-24 01:04 clown 阅读(2017) 评论(0) 推荐(0) 编辑
摘要: http://kqwd.blog.163.com/blog/static/4122344820117191351263/ 阅读全文
posted @ 2012-07-18 22:05 clown 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1.Get请求string strURL = "http://localhost/WinformSubmit.php?tel=11111&name=张三";System.Net.HttpWebRequest request;// 创建一个HTTP请求request = (System.Net.HttpWebRequest)WebRequest.Create(strURL);//request.Method="get";System.Net.HttpWebResponse response;response = (System.Net.HttpWe 阅读全文
posted @ 2012-07-09 17:36 clown 阅读(530) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Xml;namespacePuTianCheng{///<summary>///XmlHelper的摘要说明///</su 阅读全文
posted @ 2012-07-09 17:08 clown 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 如果使用.Net Framework 3.5的话,事情就很简单了。呵呵。 如果不是的话,还是自己写排序吧。 using System; using System.Collections.Generic; using System.Text; using System.Linq; namespace DictionarySorting { class Program { static void Main(string[] args) { Dictionary<int, string> dic = new Dictionary<int, string>(); dic.Add 阅读全文
posted @ 2012-03-14 13:47 clown 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 事件(event),这个词儿对于初学者来说,往往总是显得有些神秘,不易弄懂。而这些东西却往往又是编程中常用且非常重要的东西。大家都知道windows消息处理机制的重要,其实C#事件就是基于windows消息处理机制的,只是封装的更好,让开发者无须知道底层的消息处理机制,就可以开发出强大的基于事件的应用程序来。 先来看看事件编程有哪些好处。 在以往我们编写这类程序中,往往采用等待机制,为了等待某件事情的发生,需要不断地检测某些判断变量,而引入事件编程后,大大简化了这种过程: - 使用事件,可以很方便地确定程序执行顺序。 - 当事件驱动程序等待事件时,它不占用很多资源。事件驱动程序与过程式程序最大 阅读全文
posted @ 2012-01-06 19:53 clown 阅读(1806) 评论(1) 推荐(2) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 17 下一页