随笔分类 -  C#

摘要:(1)首先引用这两个命名空间 (2)两种方式调用资源文件中的内容 其中的 “WindowsFormsApplication1.Properties.Resources” 就是资源在本项目的命名空间路径,如图: 阅读全文
posted @ 2017-03-12 23:36 緣來如此
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices; //调用API,需要引用这个命名空间namespace WindowsFormsApplication2{ public partial class Form1 : Form { /... 阅读全文
posted @ 2013-01-03 22:29 緣來如此
摘要:C#定义了一个类System.Windows.Forms.Clipboard来简化剪切板操作,这个类有一个静态方法,主要有:Clear 清除剪切板中的所有数据;ContainsData,ContainsAudio,ContainsFlieDropList,ContainsText,ContainsImage,用于检查剪切板中是否存在相应的数据;GetAudioStream,GetDataObject,GetText,GetImage,GetFileDropList,用于取得数据;SetAudio,SetDataObject,SetText,SetImage,SetFileDropList,用于 阅读全文
posted @ 2011-06-29 09:53 緣來如此
摘要:///主要是响应控件的两个事件:一个是触发鼠标拖动并进入控件区域时,一个是触发鼠标拖动到该控件区域时的释放.///拖动的对象需要从这两个事件的参数中获取,及从e中获得.///先要把你想接受拖放功能的控件的AllowDrop功能打开.this.textBox2.AllowDrop = true;this.textBox2.Multiline = true;privatevoidtextBox2_DragDrop(objectsender,DragEventArgse){///创建一个数组类,用于保存拖动进来的数据组,这里是文件名路径的数组(多个文件拖进来的情况)///e.Data.GetData 阅读全文
posted @ 2011-02-24 16:32 緣來如此
摘要:Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones]"TzVersion"=dword:07da0300[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Afghanistan Standard Time]"MUI_Display"="@tzres.dll,-460" 阅读全文
posted @ 2011-02-23 13:57 緣來如此
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Runtime.InteropSe 阅读全文
posted @ 2011-02-21 14:39 緣來如此
该文被密码保护。
posted @ 2011-02-05 02:12 緣來如此
该文被密码保护。
posted @ 2011-02-05 00:48 緣來如此
该文被密码保护。
posted @ 2011-01-23 11:36 緣來如此
摘要:自定义类:webcyz 包括[属性,虚方法,事件,自定义委托]webcyz的派生类:重载了虚方法,截获事件触发,提前完成自定义代码.其中事件参数 类:EventArgs //所有事件参数类的基类.//代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespace委托{classwebcy 阅读全文
posted @ 2011-01-21 21:16 緣來如此
该文被密码保护。
posted @ 2011-01-13 16:08 緣來如此
该文被密码保护。
posted @ 2011-01-10 23:52 緣來如此
摘要:个人觉得"反射"就是能按照规定(微软.net)动态访问特定程序集中对象的工具.网上找的代码:例子://使用反射方:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Reflection;namespaceConsoleApplication1{classProgram{st 阅读全文
posted @ 2011-01-10 22:54 緣來如此
摘要:MSDN:"尽管实际上对 C 或 C++ 中的每种指针类型构造,C# 都设置了与之对应的引用类型,但仍然会有一些场合需要访问指针类型。例如,当需要与基础操作系统进行交互、访问内存映射设备,或实现一些以时间为关键的算法时,若没有访问指针的手段,就不可能或者至少很难完成。为了满足这样的需求,C# 提供了编写不安全代码的能力。在不安全代码中,可以声明和操作指针,可以在指针和整型之间执行转换,还可以获取变量的地址,等等。在某种意义上,编写不安全代码很像在 C# 程序中编写 C 代码。"不安全代码必须用修饰符 unsafe 明确地标记。这里所谓的编写"不安全代码",就是要跳出.net CLR的限制,自己 阅读全文
posted @ 2011-01-06 16:11 緣來如此

留言板