![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
.Net
文章平均质量分 74
xyjchinese
人——男人——未婚男人。。。
展开
-
关于强名称的使用来防止DLL被非法调用
最近在想怎么才能防止DLL非法调用的问题,想来想去也没想到什么好的方法。只想到了下面这么一个方法,但是对一般的人来说还是管用的。平台:WinXP sp3,Visual Studio 2008 Professional(CN)1)程序分为:MyEXE.exe 和 MyDLL.dll2)用MyKey.snk 签名 MyEXE.exe 和 MyDLL.dll3)测试代码如下://MyDLLname原创 2009-04-12 14:23:00 · 1272 阅读 · 0 评论 -
Winform 启动时的渐入渐出效果
两个form: frmLogo,logo窗口,启动时渐入渐出。 MainForm,程序的主窗口。 //frmLogo.Designer.cs 部分代码namespace FormTransparentEffectAtStart_up{ //省略部分不重要的代码 /// /// Required method原创 2009-04-12 15:51:00 · 727 阅读 · 0 评论 -
创建RichTextBox的右键菜单(比较基础的东西了)
private void 复制ToolStripMenuItem_Click(object sender, EventArgs e) { this.contextMenuStrip1.SourceControl.Select();//先获取焦点,防止点两下才运行 RichTextBox rtb = (RichTe原创 2009-04-12 15:56:00 · 1340 阅读 · 0 评论 -
委托与事件
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Sample_CUI{ namespace Delegate_And_Event { /* 场景 XXX收到一个解决方案(内网建设方案)原创 2009-04-12 14:05:00 · 229 阅读 · 0 评论 -
.NET中的加密解密:私钥加密(对称加密):AES、DES、RC2、Rijindael、TripleDES
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Security.Cryptography;using System.IO;namespace Sample_CUI{ namespace Encryption_And原创 2009-04-12 14:15:00 · 713 阅读 · 0 评论 -
.Net 中通用的FormatString格式符整理
格式说明符名称说明d短日期模式显示由与当前线程关联的 DateTimeFormatInfo.ShortDatePattern 属性定义的模式或者由指定格式提供程序定义的模式。D长日期模式显示由与当前线程关联的 DateTimeFormatInfo.LongDateP转载 2009-04-12 14:29:00 · 292 阅读 · 0 评论 -
Visual Studio 2005 Windows Forms Controls List
Visual Studio 2005 Windows Forms Controls List (part) CategoryControl NameRemarkData DisplayDataGridView Data Binding And Navigation转载 2009-04-12 14:34:00 · 342 阅读 · 0 评论 -
Error:'Sys' is undefined.
关于这个错误,在网上找了10分钟,发现90%的解决方案都是改写Web.config。但我发现这解决方案有点不地道啊。最后还是看了一个老外的说法才毛色顿开。看下面代码就知道解决方案了。 无标题页 <!-- //如果此处使用了 Sys 则会引发 Sys is undefined.错误。 // -->原创 2009-04-12 15:12:00 · 678 阅读 · 0 评论 -
ClientScriptManager与ScriptManager向客户端注册脚本的区别
刚刚看了Jeffrey Zhao老师的Ajax课程,写了个笔记,留着以后查找方便,如有不对地方,还请指正。 -----------------------------------------------------------------------------------------使用ClientScriptManager向客户端注册脚本 ClientScriptManager原创 2009-04-12 15:16:00 · 480 阅读 · 0 评论 -
常用MIME类型大全
常用MIME类型大全 application/vnd.lotus-1-2-33gp video/3gppaab application/x-authoware-binaam application/x-authoware-mapaas application/x-authoware-segai application/postscriptaif audio/x-aiffaifc audio转载 2009-04-12 15:22:00 · 430 阅读 · 0 评论 -
msdn中一段打印的代码
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { int charactersOnPage = 0;//字符串中的字符数。 int linesPerPage =转载 2009-04-12 15:50:00 · 364 阅读 · 0 评论 -
使用FileUpload控件上传前预览图片
Preview Image In FileUpload <!-- #newPreview{ FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale) } -->原创 2009-04-12 15:36:00 · 733 阅读 · 0 评论 -
一个自定义属性(Attribute)的Demo
using System;using System.Collections.Generic;using System.Text;using System.Reflection;//使用反射namespace CUI.UseAttribute{ //应用AttributeUsage特性来控制如何该特性的用处 [AttributeUsage(Attribu原创 2009-04-12 14:32:00 · 485 阅读 · 0 评论 -
IComparable and IComparer
using System;using System.Collections.Generic;using System.Text;using System.Collections;namespace Sample_IComparable_and_IComparer{ /// /// Course Enum 课程枚举 /// p原创 2009-04-12 14:37:00 · 267 阅读 · 0 评论 -
显式接口实现(C# 编程指南)
如果类实现两个接口,并且这两个接口包含具有相同签名的成员,那么在类中实现该成员将导致两个接口都使用该成员作为它们的实现。例如:interface IControl{ void Paint();}interface ISurface{ void Paint();}class SampleClass : IControl, ISurface{转载 2009-04-12 14:42:00 · 308 阅读 · 0 评论 -
将DAL层从Sql Server 迁移到 Access 时遇到的问题
1)异常:IErrorInfo.GetDescription 因 E_FAIL(0x80004005) 而失败。 此问题主要原因是对Access执行的SQL语句中包含了Access不支持的成分(如Sql Server中的函数)。2)无法Update 当迁移到Access上以后发现表无法执行跟新操作,而且也不报什么错误。 此问题的主要原因是DAL层中构建的原创 2009-04-12 14:47:00 · 331 阅读 · 0 评论 -
异步Ado.Net操作
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient原创 2009-04-12 14:51:00 · 388 阅读 · 0 评论 -
ListView:How to....
内容:增加,编辑,删除,排序,分页。<%@ Page Title="" Language="C#" MasterPageFile="~/Mail/MailMasterPage.master" AutoEventWireup="true" CodeBehind="MailContacts.aspx.cs" Inherits="Dftr.Web.Mail.MailContacts" %原创 2009-04-12 14:53:00 · 525 阅读 · 1 评论 -
VS2008 下安装 AjaxControlToolkit-Framework3.5
重点: 1)不要安装ASP.NET 2.0 AJAX Extensions 1.0 和 ASP.NET 2.0 AJAX Templates for VS2008 原因:因为VS2008已经默认支持Ajax了。如果你装了这个,以后在工具栏中则无法显示AjaxControlToolkit的控件了。 安装步骤: 1)下载 AjaxControlToo原创 2009-04-12 15:14:00 · 567 阅读 · 0 评论 -
使用FileUpload上传文件时用js给出提示...
其实很简单,主要是我没怎么好好看过js,所以还是想了一会儿才想出来。。。感觉这代码有种骗人的感觉 Upload <!-- function jsUpload(id,attributeName,attributeValue) { if(arguments[0] == null || arg原创 2009-04-12 15:23:00 · 1001 阅读 · 0 评论 -
搜索框中输入文本自动提示候选项代码(像google那样的)
无标题页<!-- var intIndex=0;arrList = new Array(); function test() { dearray("1111,222,222a,aaa,aa1,bb,b222,b3,323313,3213,32213,dsfsdddd"); smanPromptLi转载 2009-04-12 15:29:00 · 2323 阅读 · 1 评论 -
实现IHttpHandler接口来控制文件下载权限
今天碰到了一个很棘手的问题,由于原来从来没做过这方面的考虑,所以一上来就把我搞蒙了,还好baidu,google了半天(连迅雷都用上了。。。)终于解决了这个问题。 如果你想控制某个.aspx页面不让未授权用户访问,那么写个web.config就OK了,但是如果你想控制rar,zip……等等文件的访问就不是这么简单的了,有人说隐藏下载地址,用session判断啊什么的,我觉得这纯属是对付,万原创 2009-04-12 15:25:00 · 938 阅读 · 0 评论