
ASP.NET
asthlon
这个作者很懒,什么都没留下…
展开
-
读取嵌入到 Dll 文件中的资源文件
private static Hashtable _asmfiles;public static byte[] LoadAssemblyFiles(string filename) { if (filename == null) { throw new ArgumentNullException("filename"); } if (!filename.StartsWi原创 2006-07-19 12:36:00 · 1653 阅读 · 0 评论 -
C#发送邮件
//TODO:发送邮件 private void Btn_Send_Click(object sender, System.EventArgs e) { msgTo.From = "amthlon@tom.com"; msgTo.BodyFormat = MailFormat.Text ; msgTo.Body = mailtxt; msgTo.Subject = title原创 2004-12-23 11:00:00 · 1363 阅读 · 0 评论 -
C#中实现简体,繁体web页面[转贴]
1 在工程中引用Microsoft.VisualBasic.dll 一般此文件在.net框架环境目录中如C:/ WINNT /Microsoft.NET /Framework /v1.1.4322 /Microsoft.VisualBasic.dll。 2 使用方法 Microsoft.VisualBasic.Strings.StrConv( “inst转载 2004-12-22 10:30:00 · 947 阅读 · 0 评论 -
Excel报表的生成[转贴]
在一般的企业应用开发中都会涉及到报表的生成,且一般报表的格式都是生成Excel格式的。对于各种报表的生成一直是程序员心中永远的痛,因为对于很多程序员来说每写一个报表都意味着要写一大断代码来实现,而且有的报表可能极其复杂以及不规范,这时就会浪费程序员大量的时间来编写和调试这些代码,那到底有没有一种方法能使代码尽量少写,且又能实现各种Excel报表的生成呢,下面我们就转入正题。 我们要生成Excel报转载 2004-12-22 10:27:00 · 1631 阅读 · 1 评论 -
DataGrid自动求和、合并单元格、排序
using System;using System.Web.UI;using System.Web.UI.WebControls;using System.ComponentModel;using System.Data;using System.Data.SqlClient;namespace SunService{/// /// Summary description for DataGrid原创 2004-12-22 10:10:00 · 1794 阅读 · 0 评论 -
C#创建XML文件
public void CreateAppXML(string memid,string lgname){ string filename; filename = lgname + "_" + memid + ".xml"; filename = System.Web.HttpContext.Current.Server.MapPath("~//DeskTop//m原创 2004-12-02 15:59:00 · 3036 阅读 · 0 评论 -
C#实现饼图与棒图
using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.WebContr原创 2004-11-22 16:58:00 · 2374 阅读 · 0 评论 -
C#实现大文件分块发送到客户端
System.IO.Stream iStream = null; // Buffer to read 10K bytes in chunk: byte[] buffer = new Byte[10000]; // Length of the file: int length; // Total bytes to read: long dataToRead; // Identify原创 2004-11-18 09:58:00 · 1509 阅读 · 0 评论 -
C#图片验证码
using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.WebContr原创 2004-11-12 10:19:00 · 1940 阅读 · 2 评论 -
在C#中将.bmp转为.jpg格式的函数
public class Bmp2Jpeg { private long lQuality=50L; private ImageCodecInfo myImageCodecInfo; private原创 2004-11-03 10:42:00 · 2612 阅读 · 1 评论 -
Rewrite URLs
One of the more obscure - but potentially useful - methods in the portion of the .NET Framework that comprises ASP.NET is the HttpContext classs RewritePath method. Used internally by ASP.NET to stri原创 2004-11-03 10:25:00 · 921 阅读 · 0 评论 -
C#分割字符串
第一种方法:打开vs.net新建一个控制台项目。然后在Main()方法下输入下面的程序。 string s="abcdeabcdeabcde"; string[] sArray=s.Split(c); foreach(string i in sArray) Co原创 2004-11-03 10:35:00 · 2351 阅读 · 0 评论 -
基于窗体的身份验证
基于窗体的身份验证是 ASP.NET 身份验证服务,它使应用程序能够提供它们自己的登录 UI 和进行它们自己的凭据验证。ASP.NET 验证用户的身份,将未授权的用户重定向到登录页并执行所有必要的 Cookie 管理。这种身份验证是许多 Web 站点使用的流行方法。应用程序必须被配置成使用基于窗体的身份验证,将 设置为 Forms 并且拒绝匿名用户访问。下面的示例说明如何在所需应用程序的 W原创 2004-10-26 14:17:00 · 1091 阅读 · 0 评论 -
用C#实现生成PDF文档[转帖]
//write by wenhui.orgusing System;using System.IO;using System.Text;using System.Collections;namespace PDFGenerator{public class PDFGenerator{static float pageWidth = 594.0f;static float pageDepth原创 2005-01-18 10:55:00 · 882 阅读 · 0 评论 -
[转]提取HTML代码中文字的C#函数
/// /// 去除HTML标记 /// /// 包括HTML的源码 /// 已经去除后的文字 public static string StripHTML(string strHtml) { string [] aryReg ={ @"]*?>.*?", @"//[""tbnr]|[^/7])*?/7|/w+)|.{0})|/s)*原创 2005-03-01 09:19:00 · 1280 阅读 · 0 评论 -
读取嵌入到 Dll 文件中的资源文件
private static Hashtable _asmfiles;public static byte[] LoadAssemblyFiles(string filename) { if (filename == null) { throw new ArgumentNullException("filename"); } if (!filename.StartsWi原创 2006-07-19 12:37:00 · 1379 阅读 · 0 评论 -
读取嵌入到 Dll 文件中的资源文件
private static Hashtable _asmfiles;public static byte[] LoadAssemblyFiles(string filename) { if (filename == null) { throw new ArgumentNullException("filename"); } if (!filename.StartsWi原创 2006-07-19 12:34:00 · 1297 阅读 · 0 评论 -
OleDbSchemaGuid的应用
string ConStr; ConStr = "Provider=SQLOLEDB;data source=127.0.0.1;uid=sa;pwd=;database=KWDataBase"; DataTable STable; DataTable SDTable; DataTable SFTypeTable; OleDbConnection OleDbCon = n原创 2006-05-19 11:36:00 · 2657 阅读 · 0 评论 -
改进型分页控件,用于 DataGrid,DataList,Repeater 控件分页操作
using System;using System.Collections;using System.Text;using System.Web.UI;using System.Web.UI.Design;using System.Web.UI.WebControls;using System.Collections.Specialized;using System.ComponentModel;原创 2006-04-13 17:17:00 · 2051 阅读 · 0 评论 -
自定义分页控件用于DataGrid(使用SQL储存过程)
分页储存过程: 网上找的一个改了一下!/* 函数名称: GetRecordFromPage 函数功能: 获取指定页的数据 参数说明: @tblName 包含数据的表名 @PKName 关键字段名 @strGotFields 要获取的字段 @PageSize 每页记录数 @PageIndex原创 2005-11-16 17:06:00 · 2109 阅读 · 0 评论 -
采用TripleDES加密类给 cookie 进行加密
using System;using System.Security;using System.Security.Cryptography;using System.Diagnostics;using System.Text;using System.IO;using System.Web;namespace PSMCryptoUtil{ /// /// 采用 TripleDES 加密 ///原创 2005-05-23 09:48:00 · 1477 阅读 · 0 评论 -
通过WebRequest获取远程网页图片
using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Drawing.Drawing2D;using System.Web;using System.Web.SessionState;using System.Web.原创 2005-05-20 11:18:00 · 3166 阅读 · 0 评论 -
右键菜单[写入注册表]读取所选文字图片并将地址发送到指定页面!
注册表文件REGEDIT4[-HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/+ Offline &Explorer: Download the link][-HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/MenuExt/+ Offline E&xplore原创 2005-04-11 15:50:00 · 1482 阅读 · 0 评论 -
Asp使用XMLHTTP方式上实现数据抓取!
Function Getbody(Url) On Error Resume Next Set Retrieval = Createobject("Microsoft.Xmlhttp") With Retrieval .Open "Get", Url, False, "", "" .Send Getbody = .Responsebody End With Set Re原创 2005-08-03 16:27:00 · 2096 阅读 · 3 评论 -
DataList 控件分页操作!
aspx 源文件 NJ列表 .normal { font-weight:normal } .bigsize { font-weight:bold; } --> RepeatColumns="2" RepeatDirection="Horizontal" HorizontalAlign="Center" ShowHeader="False" CellPadding="5原创 2005-03-25 17:41:00 · 1467 阅读 · 0 评论 -
C#函数列表
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=currentTime.Month; 1.4 取当前日 int 日=curre原创 2005-03-08 15:11:00 · 1187 阅读 · 0 评论 -
[转]使用C#生成RSS
--- RSS.aspx.csusing System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.原创 2005-03-08 15:06:00 · 2221 阅读 · 0 评论 -
ASP.NET中使用Caching
Caching缓存,就是将一些生成代价比较大的常用数据,保存起来重用。一般数据都保存在内存中,因为从内存中读取数据比从数据库等其他地方要快。 ASP.NET通过两种方式支持缓存:通过Cache API存储任意数据,通过页面输出缓存经常被访问的页面。让我们来看一个例子。 一个电子商务的站点, 它的目录一般一周更新一次。站点提供了一套用户界面让客户订购产品。当一个客户浏览目录时,系统将通过原创 2004-10-25 11:40:00 · 787 阅读 · 0 评论 -
asp.net上传图片并生成缩略图
Sub UploadFile(sender As Object, e As EventArgs)If FileUp.PostedFile.ContentLength = 0 ThenFileInfo.Visible = FalseExit SubElseFileInfo.Visible = TrueFDisplay1.Visible = TrueEnd IfFSize.Text ="上传文原创 2004-08-17 14:28:00 · 806 阅读 · 0 评论 -
给图片添加版权信息
Bitmap bitmap=new Bitmap(this.pictureBox2.Width,this.pictureBox2.Height,System.Drawing.Imaging.PixelFormat.Format24bppRgb);//根据位图获取画布Graphics g=Graphics.FromImage(bitmap);//清空画布并用透明色填充g.Clear(原创 2004-08-17 14:26:00 · 2899 阅读 · 0 评论 -
用ASP.NET上传图片并生成带版权信息的缩略图
void Page_Load(Object sender, EventArgs e){if(!Page.IsPostBack){ImgPreview.Visible=false;}}void GetThumbnailImage(int width,int height,string strInfo,int left,int right){string file="Uploads/"+uploa原创 2004-08-17 14:22:00 · 797 阅读 · 0 评论 -
使文件下载的自定义连接支持 FlashGet 的断点续传多线程链接下载! C#/ASP.Net 实现
using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.WebContr原创 2004-08-11 08:50:00 · 892 阅读 · 0 评论 -
将货币的小写转换为大写,例如:肆佰陆拾贰圆捌角柒分
将货币的小写转换为大写,例如:肆佰陆拾贰圆捌角柒分 Public Function Num2Chi(ByVal txtJE As Double) As String Dim i, K As Integer Dim NC, nd, ka, chrNum, strZheng As String Dim c1, c2, c3 As String Dim K1 As In原创 2004-07-21 10:16:00 · 2585 阅读 · 0 评论 -
对称加密解密模块
Imports System.Text Imports System.Security.Cryptography Module ModSecurity Function EnText(ByVal Text As String, ByVal sKey As String) As String Text = Text.ToLower Dim des As N原创 2004-07-21 10:13:00 · 1136 阅读 · 0 评论 -
POP3
asp.net实现pop功能 asp.net实现pop功能 pop.aspx protected void Page_Load(Object Src, EventArgs E){ String user="doufu"; //邮箱用户代码 String pass="asp888.net"; //邮箱用户密码 String popserver="loc原创 2004-07-21 10:12:00 · 987 阅读 · 0 评论 -
异步方式解析域名
C# NetWork Programming里面一个例子,通过异步的方式解析域名。主要是应用Dns类的BeginResolve(),和EndResolve()方法。此例子有一个问题就是当碰到解析不出来的域名时,不会调用AsyncCallback指定的函数。我加了几句代码,设定2秒钟超时时间,超时的话,显示超时。现在的问题是,超时后并没有结束域名的解析。超过2秒钟解析出的域名还会显示到listBox原创 2004-07-30 15:30:00 · 823 阅读 · 0 评论 -
返回8位小写字母数字混合随机密码
返回8位小写字母数字混合随机密码 Function GetRandomPassword() As String Dim s As String() = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n"原创 2004-07-21 10:14:00 · 1811 阅读 · 0 评论 -
DataList和DataRepeater分页
ASP.NET中的DataList和DataRepeater提供了简单快速的方法來显示,其间,我们可以使用更是使我们能随心所欲的控制数据的排放样式!.可惜的是它们不像Datagrid那样,有内置的分页功能。 如何解决呢? 其实我们可以【PagedDataSource】 类来解决分页的问题。 PagedDataSource类的属性: DataSource -数据源 AllowPaging - tru原创 2004-07-30 15:28:00 · 696 阅读 · 0 评论 -
操作SQL Server完全模块
Module ModSql Function GetIntByStr(ByVal FieldName As String, ByVal TableName As String, ByVal ParaName As String, ByVal ParaValue As String) As Integer Dim sqlConnection As New SqlClien原创 2004-07-21 10:11:00 · 827 阅读 · 0 评论 -
把Excel文件中的数据读入到DataGrid中
private DataSet CreateDataSource(){string strConn;strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +"Data Source=C://Inetpub//wwwroot//contacts.xls;"+"Extended Properties=Excel 8.0;";Ol原创 2004-08-17 14:29:00 · 770 阅读 · 0 评论