
C#
文章平均质量分 51
xsi640
这个作者很懒,什么都没留下…
展开
-
c#异步入门
能用异步,就不要用线程,感觉线程要是控制不好,比较容易出问题 1 //要异步完成的方法 2 private void AddRadNum() 3 { 4 while(true) 5 { 6 Random r = new Random(); 7原创 2014-06-10 22:29:18 · 342 阅读 · 0 评论 -
wpf中listview添加排序
this.ListView1.Items.SortDescriptions.Add(new SortDescription("UserName", ListSortDirection.Ascending)); this.ListView1.Items.SortDescriptions.Add(new SortDescription("Age", ListSortDirection.Descendi原创 2014-06-10 22:30:44 · 597 阅读 · 0 评论 -
异步编程概述
原文:http://hxhbluestar.cnblogs.com/articles/60023.html.NET Framework 允许您异步调用任何方法。定义与您需要调用的方法具有相同签名的委托;公共语言运行库将自动为该委托定义具有适当签名的 BeginInvoke和 EndInvoke方法。 BeginInvoke方法用于启动异步调用。它与您需要异步执行的方法具有相同的参数,只不过转载 2014-06-10 22:29:33 · 506 阅读 · 0 评论 -
popup non topmost
public class PopupNonTopmost : Popup { public static DependencyProperty TopmostProperty = Window.TopmostProperty.AddOwner( typeof(PopupNonTopmost), new Framewor原创 2014-06-10 22:31:09 · 580 阅读 · 0 评论 -
SilverLight是什么?(来自Csdn)
SilverLight是Windows PresentATIonFoundation的一个子产品,其利用了跨浏览器Web技术进行设计,以实现多操作系统,甚至是移动设备上的无缝运行。和Flash一样,WPF/E是作为一个浏览器的插件,可以显示矢量图形、动画和视频。 Silverlight集成了多种现有Web技术和设备,它可以在Windows、Mac平台上运行,支持IE、Firefox,转载 2014-06-10 22:30:14 · 485 阅读 · 0 评论 -
SynchronizationContext
/// /// MainWindow.xaml 的交互逻辑 /// public partial class MainWindow : Window { SynchronizationContext _uiContext = SynchronizationContext.Current; public MainWind原创 2014-06-10 22:31:01 · 490 阅读 · 0 评论 -
Winform中为窗口设置双缓冲
请在构造函数里面底下加上如下几行:SetStyle(ControlStyles.UserPaint, true);SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲参数说明:UserPaint原创 2014-06-10 22:29:54 · 11027 阅读 · 0 评论 -
GDI+入门
GDI+,图形设计接口..用命令,来完成各种绘制//创建一个Graphics对象,就是创建了一个画板Graphics g = this.CreateGraphics();//实例化一支笔Pen p = new Pen(Color.Red, 5);//画一个矩形g.DrawRectangle(p, 10,10,50,20);很简单,有点像最早的海龟画图,不过,比那原创 2014-06-10 22:29:20 · 429 阅读 · 0 评论 -
MD5加密方法
/**//// /// 16位MD5加密方法/// /// 原文/// 密文public static string getMd5(string str){ MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); string getstr = BitConverter.ToStrin原创 2014-06-10 22:29:24 · 412 阅读 · 0 评论 -
.Net Core 之 HelloWorld
.Net Core出来这么久了,今天来做个HelloWorld例子。其实,这个例子是微软官方提供的。so easy。访问下面网址,这里已经给出了HelloWord这个例子的步骤。http://dotnet.github.io/getting-started/1.下载并安装.Net Core。很简单,一路Next就行。2.在命令行下打几个命令原创 2016-04-25 14:33:26 · 681 阅读 · 0 评论 -
多线程下载或上传数据限速
public class SpeedLimit { private const int BalancerUp = 50; private const int BalancerDown = -75; private double _CurrentWait; private bool _Enabled;原创 2014-06-10 22:31:05 · 848 阅读 · 0 评论 -
wpf jumplist demo
/// /// MainWindow.xaml 的交互逻辑 /// public partial class MainWindow : Window { [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern int Register原创 2014-06-10 22:30:57 · 537 阅读 · 0 评论 -
WPF 在代码中Binding
Binding binding = new Binding(); //实例化绑定binding.Source = this.TextBox1; //设置绑定源binding.Path = new PropertyPath("Text"); //设置绑定属性this.TextBox2.SetBinding(TextBox.TextProperty, binding); //设置控件绑定原创 2014-06-10 22:30:31 · 708 阅读 · 0 评论 -
递归树
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.We原创 2008-08-27 22:35:00 · 782 阅读 · 0 评论 -
web.config 配置节点加密
在 web.config 中可以存储数据库连接语句(通常存于 ),也可以存储 SQL语句(通常存于),这样在我们的程序中就可以非常方便地调用,特别是 .NET Framework 2.0中使用声明式数据绑定,更是需要将这些信息存储在 web.config 中。利用明文存储这些敏感信息是不明智的,这就需要加密。利用 aspnet_regiis 对 web.config 加密C:/原创 2009-02-05 09:51:00 · 1732 阅读 · 0 评论 -
读取连接字符串
web.config default.aspx protected void Page_Load(object sender, EventArgs e) { this.Response.Write(WebConfigurationManager.AppSettings["TempConnectionStri原创 2009-02-10 15:43:00 · 468 阅读 · 0 评论 -
ASP.NET网站特殊文件夹
App_Browsers包含浏览器定义(.browser文件),asp.net会使用这些文件来辨识个别浏览器并判断它们的功能App_Code 包含用于公用程序类和商务对象(Business Object)(例如,.cs,.vb和.jsl文件)的源程序代码,您要将它编译为应用程序的一部分,在动态编译的应用程序中,asp.net会在应用程序发出初始要求时,编译App_Code文件夹中的程序原创 2009-02-10 16:28:00 · 662 阅读 · 0 评论 -
ASP.NET动态注册Javascript
RegisterClientScriptBlock将JavaScript区块添加页面顶端。您可以字符串形式创建这些代码,然后将它传递给添加网页的方法。您可以使用这种方法将任何JavaScript插入网页。请注意,在完成所有项目之前JavaScript可能就会呈现至网页。因此您可能无法从JavaScript引用网页上所有的项目RegisterClientScriptInclude这种方法类似Re原创 2009-02-11 11:00:00 · 544 阅读 · 0 评论 -
生成缩略图
/// /// 生成缩略图 /// /// 源图路径(物理路径) /// 缩略图路径(物理路径) /// 缩略图宽度 /// 缩略图高度 /// 生成缩略图的方式 public static void MakeThumbnail(原创 2009-03-12 15:06:00 · 385 阅读 · 0 评论 -
不重复的随机数
long tick = DateTime.Now.Ticks;Random ran = new Random((int)(tick & 0xffffffffL) | (int) (tick >> 32));原创 2009-03-12 15:07:00 · 417 阅读 · 0 评论 -
windows下删除svn注册表。
Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]@="Delete SVN Folders"[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]@="原创 2014-06-10 09:26:57 · 9418 阅读 · 1 评论 -
免费的数据库建模工具
http://www.codebydesign.com/CodeByDesign原创 2014-06-10 09:31:29 · 968 阅读 · 0 评论 -
c#使用扫描仪
最近有个项目,需呀调用扫描仪。我们这里使用微软wia组件,调用扫描仪,去扫描图像。先引用这个组件,这个组件是个com组件。调用扫描仪的代码,很简单,返回一个ImageFile接口。这个ImageFile就是扫描后的图像文件。public ImageFile Scan(){ ImageFile image; try { Common原创 2016-07-11 15:16:48 · 8950 阅读 · 3 评论