文章分类 -  c#

摘要:当你将窗体的BorderStyle和ShowInTaskbar这两个属性分别设为True时,你会发现在任务栏中只显示了该窗体的Caption属性,而窗体的图标则没有显示出来。同时,如果你用鼠标右键在任务栏中单击该窗体,原本就显示的系统菜单,现在也没有了。要解决这个问题,你需要用到下面两个API函数。GetWindowLong和SetWindowLong.下面是程序示例:将下面的代码放入窗体的声明段... 阅读全文
posted @ 2009-08-18 15:54 oraclejava 阅读(201) 评论(0) 推荐(0)
摘要: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 System.Runtime.Int... 阅读全文
posted @ 2009-08-18 15:54 oraclejava 阅读(728) 评论(0) 推荐(0)
摘要:我们可能会用到一个没有边框的窗体,因为这样我们可以在整个窗体上自由的绘制。然后我们也会发现一个讨厌的问题,这个时候在任务栏上鼠标右键点不出那可爱的系统菜单了。这样会不好,会使得用户感觉到没有道理,为什么别的窗口都有系统菜单,而只有我们的窗体没有系统菜单呢?   其实如果我们使用VC建立MFC程序的时候,我们可以把窗体的“Title Bar”设置为False,这样MFC的窗口... 阅读全文
posted @ 2009-08-18 15:53 oraclejava 阅读(411) 评论(0) 推荐(0)
摘要:添加 Microsoft Visual Basic.NET Runtime 引用。using System;using System.IO;using System.Text;using Microsoft.VisualBasic;namespace Rainsoft.Text{/// <summary>/// 字符串编码转换类/// </summary>public cl... 阅读全文
posted @ 2009-08-18 15:52 oraclejava 阅读(566) 评论(0) 推荐(0)
摘要:引言:谁都希望自己的应用程序能让人留下一个深刻的印象,让自己的程序窗体有一件与众不同的"外衣"是一个好办法。试想:在一大堆的普通窗口中突然跳出一个很酷的界面,一定能让人眼睛一亮进而产生兴趣的。在VB,VC中如何定制可伸缩个性化窗口早就不是什么秘密了,已经有了大量相关的文章进行介绍,无非都是如何调用系统API之类的方法,但是在.Net中调用API却相对比较麻烦,所以使用.Net制作个性化窗体的文章也... 阅读全文
posted @ 2009-08-18 15:51 oraclejava 阅读(268) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.SqlClient;using System.Windows;using System.Windows.Forms;using System.Collections;namespace Windows... 阅读全文
posted @ 2009-08-18 15:48 oraclejava 阅读(186) 评论(0) 推荐(0)
摘要:Ctrl+m+Crtr+o折叠所有大纲Ctrl+M+Crtr+P: 停止大纲显示Ctrl+K+Crtr+C: 注释选定内容Ctrl+K+Crtr+U: 取消选定注释内容Ctrl+J : 列出成员 智能感知Ctrl+B,T / Ctrl+K,K: 切换书签开关Ctrl+B,N / Ctrl+K,N: 移动到下一书签Ctrl+B,P: 移动到上一书签Ctrl+B,C: 清除全部标签 Ctrl+I: 渐... 阅读全文
posted @ 2009-08-18 15:47 oraclejava 阅读(142) 评论(0) 推荐(0)
摘要:最近要做一个项目涉及到C#中压缩与解压缩的问题的解决方法,大家分享。这里主要解决文件夹包含文件夹的解压缩问题。1)下载SharpZipLib.dll,在http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx中有最新免费版本,“Assembliesfor.NET1.1,.NET2.0,.NETCF1.0,.NETCF... 阅读全文
posted @ 2009-08-18 15:45 oraclejava 阅读(432) 评论(0) 推荐(0)
摘要:我们知道,C#里面有选择文件的对话框控件,却没有选择文件夹的对话框控件,不少人为了选择一个文件夹只好自己用TreeView类来处理,其实在C#里面完全不用那么麻烦,我们可以用C#的FolderNameEditor类的子类FolderBrowser类来实现获取浏览文件夹对话框的功能。   下面来看看具体是怎么实现的。  首先新建一个winform的项目,再新建一个类文件(File->AddNe... 阅读全文
posted @ 2009-08-18 15:44 oraclejava 阅读(179) 评论(0) 推荐(0)
摘要:FileAttributes fa = File.GetAttributes(filename);File.SetAttributes(filename, FileAttributes.Hidden | fa);//隐藏文件,并且保持文件以前的属性File.SetAttributes( filename, fa & (~FileAttributes.Hidden) );//取消隐藏属性 阅读全文
posted @ 2009-08-18 15:43 oraclejava 阅读(689) 评论(0) 推荐(0)
摘要:using System;using System.Runtime.InteropServices;namespace MyAssist{/// <summary>/// netstat 的摘要说明。/// </summary>public class netstat{[DllImport("wininet.dll")]private extern static bool ... 阅读全文
posted @ 2009-08-18 15:43 oraclejava 阅读(152) 评论(0) 推荐(0)
摘要:/// <summary> /// 汉字拼音声母计算类 /// Write by WangZhenlong at 2003/11/29 /// </summary> [code=C#] /// <summary> /// 汉字拼音声母计算类 /// Write by WangZhenlong at 2003/11/29 /// 梁文刚于2009/03/26日对原... 阅读全文
posted @ 2009-08-18 15:42 oraclejava 阅读(1283) 评论(0) 推荐(0)
摘要:方法一: usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Runtime.InteropServices;namespac... 阅读全文
posted @ 2009-08-18 15:40 oraclejava 阅读(996) 评论(0) 推荐(0)
摘要:protectedvoidResponseFile(stringfileContent,stringfilename){stringcoding="gb2312";Response.Clear();Response.Charset=coding;Response.Buffer=true;this.EnableViewState=false;Response.ContentEncoding=Syst... 阅读全文
posted @ 2009-08-18 15:39 oraclejava 阅读(158) 评论(0) 推荐(0)
摘要:使用反射调用指定的服务器端程序集Server端:1usingSystem;2usingSystem.Collections.Generic;3usingSystem.Text;4usingSystem.Runtime.Remoting.Channels.Tcp;5usingSystem.Runtime.Remoting.Channels;6usingSystem.Runtime.Remoting;... 阅读全文
posted @ 2009-08-18 15:37 oraclejava 阅读(221) 评论(0) 推荐(0)
摘要:使用VS2005 编写,需.Net Framework 2.0支持using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using Mic... 阅读全文
posted @ 2009-08-18 15:30 oraclejava 阅读(335) 评论(0) 推荐(0)
摘要:1 使用COM组件操控Excel的优势和缺点2.使用方法Visual Studio 2005中默认提供了封装好的Microsoft Office 2003的.Net Excel编程模型。图中所显示的是已经安装了Office2005之后VS2005所带的.Net Excel模型。大家可以看到名为“Microsoft Excel 12.0 Object Library”的COM... 阅读全文
posted @ 2009-08-18 15:30 oraclejava 阅读(443) 评论(0) 推荐(0)
摘要:1.excel的进程的杀死.2.excel的写操作,excel的下标是从1开始的.3.对excel中空的操作.是DBnull不时null.using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.OleDb;using System.Data.SqlClie... 阅读全文
posted @ 2009-08-18 15:29 oraclejava 阅读(610) 评论(0) 推荐(0)
摘要:#region ASP.NET 图片验证码public string GenerateCheckCode() {int number;char code;string checkCode = String.Empty;System.Random random = new Random();for(int i=0; i<5; i++) {number = random.Next();if(nu... 阅读全文
posted @ 2009-08-18 15:29 oraclejava 阅读(192) 评论(0) 推荐(0)
摘要:1 usingSystem; 2usingSystem.Collections.Generic; 3usingSystem.Text;4usingExcel;5usingSystem.Reflection;67namespaceCW8{9publicclassmyExcel10{11privateApplicationClassexcelApp;1213privateWorkbookexcelBo... 阅读全文
posted @ 2009-08-18 15:28 oraclejava 阅读(726) 评论(0) 推荐(0)