C#
chenhailong118
wu
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C# XML 解析方式
今天看到了拿哥们的操作,心里倍感激动,发现.net 真的很强大,比较猛的是这个xml解析这么方便 下面就介绍一下: 写了一个sample: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; usi...2011-04-20 12:42:30 · 165 阅读 · 0 评论 -
.net 3.5 Form Chart 解决方案
刚刚写了一篇关于自己生活的文章,下面写下,最近我一直在做个项目的一些小知识把 .Net 3.5 实现对Form Chart 的操作 在.Net 4.0的时候微软提出了Chart的操作,应用到了Visual Studio 2010上面 可是由于开发的需要,暂时也用不到4.0 所以做了基本的调查 官网下载3.5 Chart 应用 http://archive.msdn.mi...2011-11-12 16:49:01 · 424 阅读 · 0 评论 -
C# winform 应用程序只打开一次(实现)
winform 有的时候只能打开一次,下一次不要打开的应用 下面是code static class ApplicationStart { /// <summary> /// The main entry point for the application. /// </summary> ...2011-11-14 13:43:57 · 995 阅读 · 0 评论 -
实现winform 代码导入dll
代码如下: [DllImport("kernel32.dll", EntryPoint = "LoadLibrary")] public static extern IntPtr LoadLibrary(string sLibName); [DllImport("kernel32.dll", EntryPoint = "FreeLibrar...2011-11-14 14:48:49 · 626 阅读 · 0 评论 -
C# 文件Copy 不包含.svn文件
今天遇到了C#文件copy的问题 现在写出了解决方案 DirectoryInfo sourceDir = new DirectoryInfo(@"文件"); DirectoryInfo destinationDir = new DirectoryInfo(@"文件"); CopyDirectory(sourceDir, destination...2011-11-18 11:48:18 · 191 阅读 · 0 评论 -
Windows Install SQL Manager Error
在安装SQL Manager的时候会出现异常,是由于操作系统的MSI版本太低的问题 http://www.microsoft.com/download/en/details.aspx?id=8483 上面为更新软件的地址 希望能对大家有用 ...2011-11-21 09:52:39 · 152 阅读 · 0 评论 -
C# Chart详细解析(待)
一年有过去了, 很长时间也没有写什么文章了,准确的说是2个月,没写正经的东西了。主要是最近生活很忙碌,工作也很忙碌。 在说,怎么说的那,你不工作,就没Money花,嗨,生活就是这样。在忙碌中寻找快乐,在快乐中给自己心灵上的满足 今天果断的写一篇文章来拟补最近没写文章的我的不足,这篇文章也是我想了很长时间才确定要写的,主要是让大家也通过这篇文章 学会C# 的Chart C# ch...2012-02-07 19:25:37 · 1694 阅读 · 0 评论 -
C# Timer运行时,系统时间修改
今天遇到一个问题: C# Time 运行的时候,将系统时间修改一下,发现Timer会自动被修改。 static void Main(string[] args) { Timer t = new Timer(); t.Interval = result; t.Interval = 2*60*10...2012-10-19 15:55:33 · 557 阅读 · 0 评论 -
winform 方向键焦点丢失问题(keydown event not work)
在项目中遇到了,方向键不能被keydown event 捕捉的问题 下面是解决方案 button1.PreviewKeyDown +=new PreviewKeyDownEventHandler(button1_PreviewKeyDown); button1.KeyDown += new KeyEventHandler(button1_KeyDown); 1...2011-12-10 11:47:24 · 439 阅读 · 1 评论 -
IIS 7.0 HTTP Error 403.14
刚才碰到一个问题:如题 下面是解决方案: 方法 1 この問題を解決するには、次の手順を実行します。 開始 IIS マネージャー.これを行うをクリックしてください。 開始をクリックして 実行、タイプinetmgr.exe、し [OK]. IIS マネージャーでは、展開します。 サーバー名を展開 Web サイト、し、変更する Web サイトをクリックします。 [機能ビュー...2012-02-23 13:09:41 · 146 阅读 · 0 评论 -
IIS not work because of Com+ Application error or IWAM user not have password
今天遇到了一个问题。XP的IIS 5.1 安装成功后会出现: Server Application Error 解决方案: 1.Com+ Applicaton error: Error code - 8004E00F - COM+ was unable to talk to Microsoft Distributed Transaction Coordinator 1.1 ...2012-02-24 16:19:00 · 128 阅读 · 0 评论 -
C# 胡乱实现,程序 占用CPU50%
今天早上看到了编程之美,我很兴奋,大早上看书,有吗? 有木有? 哈哈 想想第一节的东西。CPU占用曲线,很经典,导致我很淡定的实现了一个,主要问题 1.我电脑是双核的 2.我CPU周期很不稳定 3.OS内运行了很多东西,比如360等 由于以上的原因,我选择了书上给的C#实现,还有就是书上给的多核的建议 实现发现,code趋势在49和50左右徘徊 CPU50%...2012-02-28 07:05:43 · 487 阅读 · 0 评论 -
C# 读2007Excel文件
今天遇到一个问题: C#去读Excel文件 这里提供源代码 为了怕自己忘记,这里记录一下 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; ...2012-03-27 13:51:07 · 172 阅读 · 0 评论 -
Services do not start and Event ID 7022
今天遇到一个问题 具体的如题 解决方案: Click Start, and then click Run. In the Open box, type regedt32, and then click OK. Locate and click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\Cu...原创 2012-03-29 15:07:58 · 253 阅读 · 0 评论 -
手工添加window 服务依赖
这里是bat文件 复制就可以添加 @echo off echo set the window depends sc config "xxxx服务" depend= "xxxx服务" pause2012-03-29 15:11:19 · 149 阅读 · 0 评论 -
C# 书写window简单服务
代码如下: using System.ComponentModel; using System.Configuration.Install; using System.ServiceProcess; namespace WindowsService1 { [RunInstaller(true)] public partial class ...原创 2012-03-30 19:59:23 · 135 阅读 · 0 评论 -
Window Form所有组件按主Form扩大
今天遇到了Form 扩大到问题,写下了如下代码,希望对大家有用 添加Event this.SizeChanged += new System.EventHandler(this.××_SizeChanged); 下面就是基本的代码 private ArrayList InitialCrl = new ArrayList(); private...2011-11-08 13:08:02 · 112 阅读 · 0 评论 -
ProcessBar 2种经典实现
我今天实装了ProcessBar 的两种实现方式 下面给出了工程 具体的 1.第一种:Timer实现 2.第二种:BackgroundWorker 有问题请联系我2011-12-15 14:05:28 · 229 阅读 · 0 评论 -
C# 委托的简单应用
delegate是委托的关键字委托的声明指定了一个函数名,其中包含了一个返回类型和参数列表。在定义了委托后,就可以声明该委托类型的变量。接着把这个变量初始化与委托相同建明的函数引用。之后,就可以使用委托变量调用这个函数了。就像该变量是一个函数一样有了引用函数的变量后,还可以执行不能用的其他方式完成的操作 下面就举一个简单的例子,来看看C#是怎么操作的 using System; usi...2011-04-21 22:35:36 · 160 阅读 · 0 评论 -
C# 语言的一些遗忘点
C# 语言的以一些遗忘点 C#调试和错误处理打出错误信息Debug.Write()Trace.Write()Debug.WriteLineIf()Trace.WriteLine()Debug.WriteIf()Trace.WriteIf()Debug.Assert()Trace.Assert()在派生类中重载虚方法时,要加上override修饰符 两个窗口form1和form2 点击form1...2011-04-25 06:51:47 · 125 阅读 · 0 评论 -
C# TImer经典使用----------Label联合应用
C# TImer经典使用----------Label联合应用 今天看到一个很一本书上很经典的一句代码,真是太经典了。 下面给大家介绍一下: public event System.EventHandler Raise_Timer_tick; private void digicalTime_tick(object sender, EventArgs e...2011-04-25 22:00:20 · 375 阅读 · 0 评论 -
C# 监视目录动作
哈哈,大早上的就写文章不好啊。 因为上班晚的缘故,所以早上都很有时间,这些时间也要利用一下,所以那,就做了一下C#的目录监视的功能,很强大。 下面就给大家演示一下 我用的是main函数写的,大家也可以用Form啊什么的做个很漂亮的界面什么的都行,方法是大家的,但原理就是如下这个。 static void Main(string[] args) { ...2011-04-26 08:23:05 · 135 阅读 · 0 评论 -
C# Sandcastle 生成Document(Chm格式)3种方法
C# Sandcastle 生成Document(Chm格式)3种方法 今天研究了一下Sandcastle,一个生成像javadoc的东西。感觉以后也会用到所以给自己留个印象。在这里写下一篇文章 大家都会遇到这样的问题: 用Sandcastle生成的doc报出警告说XXXnamespace 没有<summary> 这下我就想问了,怎么给C#的代码namespace加注释呢? ...2011-04-26 17:59:30 · 227 阅读 · 0 评论 -
Visual Studio 救星 Visual Assist
今天搞到一个好东西。。。就是这个Visual Studio 的插件,很牛B,现在虽然Visual Studio 2010 也有这个功能 但以前的版本是没有的,在这里给大家这个软件,安装就行了 嘿嘿 大家尝试一下吧... 由于Javaeye对这个软件的破解有检查,所以在官网更新了一下,请大家注意...2011-05-12 13:12:16 · 122 阅读 · 0 评论 -
C#的ODBC和Mysql的链接
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.SqlClient; using MySQLDriverCS; using System.Data; namespace ADONet { class Pro...2011-02-11 21:21:33 · 182 阅读 · 0 评论 -
C# 有关SOAP的工具选择问题
C# 对于SOAP来说 有1.2 工具和1.3工具 1.2 的SOAP工具叫做 wsdl.exe 1.3的SOAP工具叫做 svcutil.exe ...\Microsoft SDKs\Windows\v6.0A\bin 下面有这两个工具 很实用。 wsdl.exe - Utility to generate code for xml web service clien...2011-06-15 09:38:33 · 274 阅读 · 0 评论 -
SQLite C#实现操作
debug command C:\1.db using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.SQLite; using System.IO; namespace CSharpConnectionSQLLite {...2011-09-22 16:53:09 · 174 阅读 · 0 评论 -
C# Process 类的思考
在这里,我先给自己留个印象 下面我们用C#实现一个调用Dos命令的小程序,让大家对系统进程能有个直观的了解.要使用Process类,首先要引入System.Diagnostic命名空间,然后定义一个新的Process类,将其制定为打开一个Cmd.exe的命令,然后根据其的StanderInput和StanderOutput对其进行命令的输入和信息的读出.具体程序如下: Process p=ne...2011-03-04 00:48:56 · 137 阅读 · 0 评论 -
C# RSA和Java RSA互通
今天调查了C# RSA和Java RSA,网上很多人说,C#加密或者java加密 ,Java不能解密或者C#不能解密 但是我尝试了一下,发现是可以的,下面就是我尝试的代码,如果您有什么问题,我想看看,他们为什么不能互通? package rsa; import java.math.BigInteger; import java.security.KeyFactory; import ...2011-07-08 15:13:31 · 171 阅读 · 0 评论 -
Log4net log文件输出限制
1.首先先继承log4net.Appender.RollingFileAppender 2.PreAppendCheck()方法override添加调用标志 比如: protected override void OpenFile(string file, bool app) { if (flag) { ...2011-09-26 17:12:52 · 282 阅读 · 0 评论 -
C# 实现文件锁
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Sy...2011-08-03 07:40:54 · 319 阅读 · 0 评论 -
using C# modify app.config in the run time
今天在印度的网站上发现一个很经典的代码,也对比了国内的网站的答案 发现了,国内的技术含量真是太低了,心情也不好了 为什么印度人能做到那么有技术性,我们为什么不能,还是学习的不够啊,所以果断的拿到国内来,和大家分享 希望在国内,我们IT业能有新的蓝天 1.app.config国内大多是把它当作xml处理 (哥们,你那叫修改,而不是在run time的环境中,鄙视) 2.简要说...2011-12-13 11:19:52 · 120 阅读 · 0 评论 -
winform 让事件提前运行
今天遇到了一个问题,就是让Winform中的事件提前运行的问题,下面我给出解决方案 Main函数 using System; using System.Windows.Forms; namespace FormLoadCompletedDemo { static class Program { /// <summary> /// The m...2011-12-15 13:54:07 · 156 阅读 · 0 评论 -
减少winform的内存使用量
今天看到有趣的代码,功能主要是减少winform的内存使用量。 大家也尝试一下吧 [DllImport("psapi.dll")] static extern int EmptyWorkingSet(IntPtr hwProc); static void MinimizeFootprint() { EmptyWorkingSet(Process.GetCurrent...2013-06-01 06:49:22 · 162 阅读 · 0 评论
分享