摘要: 发布日期: 09/19/2004 | 更新日期: 09/19/2004Chris SanoMicrosoft Corporation摘要:了解如何利用基本的 GDI 功能,从而通过 DataGrid 控件获得可视化效果。通过跨越托管边界进行调用,可以利用本机 GDI 功能来执行屏幕捕获,并最终获得拖放体验。下载 ColumnDragDataGrid.msi 文件。本页内容简介入门ScreenImage 类DraggedDataGridColumn 类ColumnDragDataGrid 类列跟踪重写 DataGrid 的 OnPaint 方法小结简介几个月以前,当我初到 Microsoft 工 阅读全文
posted @ 2004-10-26 19:59 leonardleonard 阅读(187) 评论(0) 推荐(0)
摘要: turnmissile 的 Blog http://blog.csdn.net/turnmissile/Microsoft已经把正则表达式的规则收录在了msdn里面了,有兴趣的朋友可以自己去研究一下(ms-help://MS.MSDNQTR.2003OCT.1033/cpgenref/html/cpconRegularExpressionsLanguageElements.htm),这里罗列一些我找到的语法元素功能表,大家自己研究吧!转意字符表Escaped characterDescriptionordinary charactersCharacters other than . $ ^ { 阅读全文
posted @ 2004-10-26 19:58 leonardleonard 阅读(189) 评论(0) 推荐(0)
摘要: 改成这样:string str="script language='javascript'alert('省局数据不能进行修改!');/script";Page.RegisterStartupScript("dd",str);提示成功后转到别的页面Response.Write("scriptwindow.alert('提示语句');window.location='abc.aspx'/script"); 阅读全文
posted @ 2004-10-26 19:48 leonardleonard 阅读(178) 评论(0) 推荐(0)
摘要: 作者:网际浪子专栏(曾用名littlehb) http://blog.csdn.net/littlehb/适用于:Microsoft ASP.NET摘要:asp.net动态生成html页面,适用简介此功能适用于后台数据库功能不强的web站点,即大部分文本不是存放在数据库的记录中,而是放在html文件或者xml文件中,仅仅把索引放到数据库中,如文章标题、类别、查询关键字等。这样适合于后台没有诸如MS Sql Server这样的数据库支持的Web站点。适用于新闻发布系统,比如sina、163等都是采用动态生成html页面的。适用于需动态定制页面的程序。比如论坛、聊天室等。可以加载定制好的html页 阅读全文
posted @ 2004-10-26 19:47 leonardleonard 阅读(107) 评论(0) 推荐(0)
摘要: 作者:网际浪子专栏(曾用名littlehb) http://blog.csdn.net/littlehb/一,服务器上装有CA(Certificate Server) 1,服务器上安装CA Win2000中带有CA的安装程序。单击Start,Control Pannel Add/Remove Programs兵单击Add/Remove Windows Compenents。当Windows Component Wizard出现时,选择证书服务(Certificate Services)。下一步中,安装需要指出服务器授权的类型,一般作为一个独立的Web服务器,选择Stand-alone root 阅读全文
posted @ 2004-10-26 19:44 leonardleonard 阅读(171) 评论(0) 推荐(0)
摘要: 作者:木子 http://blog.csdn.net/derny/1、把AllowPaging属性设置为true 并设置PageSize的大小2、在html页面中设置datagrid的属性OnPageIndexChanged="DataGrid_Page" ////DataGrid_Page 为点击页数的时候激发的事件 3、在程序中加入代码如下:public void DataGrid_Page(object sender,DataGridPageChangedEventArgs e){DataGrid1.CurrentPageIndex=e.NewPageIndex;BindData();/ 阅读全文
posted @ 2004-10-26 19:43 leonardleonard 阅读(184) 评论(0) 推荐(0)
摘要: 作者:张老三的专栏 http://blog.csdn.net/billy_zh/在一些应用中,希望将模式对话框的值回送(PostBack)到服务端,也就是执行一个服务端操作,从而刷新页面。举个例子:比方说新建一个订单,此时希望能在模式对话框中选择产品,并将产品的ID返回,同时刷新订单中的产品项,解决的方法有多种,这里只介绍执行服务器操作的方法。要将客户端数据回送(PostBack)到服务端并执行相应操作,显然必须提交form并设置隐藏域__EVENTTARGET的值,好在asp.net已为我们完成了这些,只要以合适的参数调用__doPostBack就可以了。另一个问题是如何把模式对话框的值也传 阅读全文
posted @ 2004-10-26 19:40 leonardleonard 阅读(132) 评论(0) 推荐(0)
摘要: 作者:网际浪子专栏(曾用名littlehb) http://blog.csdn.net/littlehb/方法一:使用模版列我们在绑定好数据的DataGrid增加一个模版列,在列中放置一个按钮asp:TemplateColumnItemTemplateasp:Button id="btnDelete" runat="server" Text="删除"/asp:Button/ItemTemplate/asp:TemplateColumn然后我们在DataGrid的ItemDataBound中添加以下代码switch(e.Item.ItemType){case(ListIt 阅读全文
posted @ 2004-10-26 19:37 leonardleonard 阅读(103) 评论(0) 推荐(0)
摘要: 作者:网际浪子专栏(曾用名littlehb) http://blog.csdn.net/littlehb/我用的是一种很笨的方法,但可以帮助初学者了解访问XML节点的过程。已知有一个XML文件(bookstore.xml)如下:?xml version="1.0" encoding="gb2312"?bookstore book genre="fantasy" ISBN="2-3631-4" titleOberon's Legacy/title authorCorets, Eva/author price5.95/price /book/booksto 阅读全文
posted @ 2004-10-26 19:36 leonardleonard 阅读(187) 评论(0) 推荐(0)
摘要: function checkCH(){var str=txtPwd.value;var c = /[\u4e00-\u9fa5]/;if(c.test(str)){alert("不能输入中文。");return false;}return true;} 阅读全文
posted @ 2004-10-26 19:34 leonardleonard 阅读(103) 评论(0) 推荐(0)
摘要: body onkeydown="if (event.keyCode==13) {document.all.button2.click()}"下面的五种方法都可以帮你解决这种问题1.script language=javascriptfunction document.onkeydown(){ if (event.keyCode == 13) { if (event.srcElement == document.getElementById('%=txtEmpCode.ClientID%')) document.getElementById('%=BtnQry.ClientID% 阅读全文
posted @ 2004-10-26 19:34 leonardleonard 阅读(119) 评论(0) 推荐(0)
摘要: 由于项目的需要不允许系统在提交之后,按IE的后退按钮进行再次提交。试试了一下在 .NET中通过如下语句Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);就可以使页面的缓存失效,每次都需要获取新页面。scripthistory.forward();/script最灵! 阅读全文
posted @ 2004-10-26 19:33 leonardleonard 阅读(122) 评论(0) 推荐(0)
摘要: 常用javascript函数(一) 作者: 无名 类别: HTML/JavaScript 日期: 2001-11-11 21:19:11 /********************************************************************************** EO_JSLib.js* javascript正则表达式检验**********************************************************************************///校验是否全由数字组成function isDigit(s){va 阅读全文
posted @ 2004-10-26 19:31 leonardleonard 阅读(159) 评论(0) 推荐(0)
摘要: 经常在网络上四处载东西,有时碰到直接拷贝一个类似http://193.100.100.56/TestWebSolution/WebApplication1/test.rar地址准备下载test.rar文件时,却被告知没有登录或者直接跳转到其他页面的情况,然后等登录后直接下载该文件。要实现上面情况,在.NET世界里是比较容易的。1、 首先创建一个类库项目ClassLibrary1,实现如下(点这里查看):using System;using System.Web; // 引用System.Web组件namespace ClassLibrary1{ public class MyHandler : 阅读全文
posted @ 2004-10-26 19:29 leonardleonard 阅读(138) 评论(0) 推荐(0)
摘要: Response.Write("script language='javascript'window.opener.location=window.opener.location.href;/script")第一种方案是:file a.htmfunction OpenDialog(url,param){return window.open(url,param, "DialogWidth:450px;DialogHeight:450px;help:no;status:no");}file b.htmscript language="javascript"function js_do( 阅读全文
posted @ 2004-10-26 19:28 leonardleonard 阅读(121) 评论(0) 推荐(0)
摘要: 作者:网际浪子专栏(曾用名littlehb) http://blog.csdn.net/littlehb/上传图片,要求图片200100象素,大小小于2M,如果图片不符合要求,不能上传,否则上传图片,上传以后对图片按系统日期动态命名,保留路径到数据库里。private void Button1_Click(object sender, System.EventArgs e){if(File1.PostedFile.ContentType.ToUpper().IndexOf("IMAGE")-1){System.Drawing.Image img= System.Drawing.Image.F 阅读全文
posted @ 2004-10-26 19:27 leonardleonard 阅读(202) 评论(0) 推荐(0)
摘要: EMBED SRC="MY_LIFE.RPM" WIDTH=300 HEIGHT=134 Tip:SRC是可以省略的,当mime Type 参数如下时:EMBED ...,TYPE="audio/x-pn-realaudio-plugin",...,这样做会产生不可预料的结果,因此强烈推荐你包含SRC属性,并且提供一个空的文件的文件名。 阅读全文
posted @ 2004-10-26 19:24 leonardleonard 阅读(171) 评论(0) 推荐(0)
摘要: 将一些HTML替换掉eg:strContent=strContent.Replace("&","&");strContent=strContent.Replace("'","''");strContent=strContent.Replace("","<");strContent=strContent.Replace("",">");strContent=strContent.Replace("chr(60)","<");strContent=strContent.Replace("chr(37)",">");strContent=strContent.Replace 阅读全文
posted @ 2004-10-26 19:23 leonardleonard 阅读(164) 评论(0) 推荐(0)
摘要: Response.Write("scriptwindow.opener=null;window.close();/script") ; 阅读全文
posted @ 2004-10-26 19:22 leonardleonard 阅读(123) 评论(0) 推荐(0)
摘要: public static long DirSize(DirectoryInfo d) { long Size = 0; // Add file sizes. FileInfo[] fis = d.GetFiles(); foreach (FileInfo fi in fis) { Size += fi.Length; } // Add subdirectory sizes. DirectoryInfo[] dis = d.GetDirectories(); foreach (DirectoryInfo di in dis) { Size += DirSize(di); } r 阅读全文
posted @ 2004-10-26 19:21 leonardleonard 阅读(106) 评论(0) 推荐(0)
摘要: 如何得到数据库中所有表字段及字段中文描述以下资料,通过csdn的一位师兄从SQL版主那得到:sql中SELECT (case when a.colorder=1 then d.name else '' end) N'表名',a.colorder N'字段序号',a.name N'字段名',(case when COLUMNPROPERTY( a.id,a.name,'IsIdentity')=1 then '√'else '' end) N'标识',(case when (SELECT count(*)FROM sysobjectsWHERE (name in (SELECT name FRO 阅读全文
posted @ 2004-10-26 19:20 leonardleonard 阅读(141) 评论(0) 推荐(0)
摘要: asp:RegularExpressionValidator id="revTextBox1" runat="server" ForeColor="Red" Display="Dynamic" ControlToValidate="textBox1" ValidationExpression="(\w|\W){1,100}"格式错误-只能输入不超过100个字符/asp:RegularExpressionValidator 阅读全文
posted @ 2004-10-26 19:18 leonardleonard 阅读(100) 评论(0) 推荐(0)
摘要: 作者:网际浪子专栏(曾用名littlehb) http://blog.csdn.net/littlehb/CREATE PROCEDURE LoginUser @loginUN char(50) OUTPUT, @loginPW char(40)ASif @loginPW = (select [password] from users where username=@loginUN) return 0;else return -1;GO要loginUN返回值,把它定义成OUTPUT的,相应的SqlCommand的参数定义里也定义也ParameterDirect.InputOutput类型的,这 阅读全文
posted @ 2004-10-26 19:18 leonardleonard 阅读(116) 评论(0) 推荐(0)
摘要: 作者:网际浪子专栏(曾用名littlehb) http://blog.csdn.net/littlehb/在域控制器或备份域控制器上安装 Microsoft Visual Studio .NET 或 Microsoft .NET 框架后,如果您尝试运行 ASP.NET 应用程序,则浏览器会显示下面的错误信息: Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Ref 阅读全文
posted @ 2004-10-26 19:15 leonardleonard 阅读(146) 评论(0) 推荐(0)
摘要: 微软的解决办法using System; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Windows.Forms; public class PagingSample: Form { // Form controls. Button prevBtn = new Button(); Button nextBtn = new Button(); static DataGrid myGrid = new DataGrid(); static Label pageLbl = new 阅读全文
posted @ 2004-10-26 19:12 leonardleonard 阅读(126) 评论(0) 推荐(0)
摘要: 作者:未知 由于本文网上多处见到 对于谁是作者 无法肯定1、下载owc11 COM组件 http://www.microsoft.com/downloads/details.aspx?FamilyID=7287252c-402e-4f72-97a5-e0fd290d4b76&displaylang=en2、注册owc11 在工程中添加 C:\Program Files\Common Files\Microsoft Shared\Web Components\11 文件下的owc11.dll引用 或者按如下图所以添加com3、在工程中添加 using OWC11;4、开始coding 举例如下: 阅读全文
posted @ 2004-10-26 19:10 leonardleonard 阅读(110) 评论(0) 推荐(0)
摘要: body onkeydown="KeyDown()"function KeyDown(){ //屏蔽退格删除键,屏蔽 F5 刷新键,Ctrl + R if ((event.keyCode==116)||(event.ctrlKey && event.keyCode==82)) { event.keyCode=0; event.returnValue=false; } } 阅读全文
posted @ 2004-10-26 19:10 leonardleonard 阅读(126) 评论(0) 推荐(0)
摘要: 程序中图片是动态显示的原先把打算把图片保存在服务器端然后显示可是由于ie的缓存问题导致图片无法实时更新显示所以改为把图片存在session中然后再显示需要保存的时候再保存到本地//--------------chart.ashx.cs-------------------using System;using System.Web.SessionState;using System.IO;using System.Web;namespace WebApplication3{/// summary/// chart 的摘要说明。/// /summarypublic class ChartH 阅读全文
posted @ 2004-10-26 19:03 leonardleonard 阅读(276) 评论(0) 推荐(0)
摘要: 作者:木子 http://blog.csdn.net/derny/首先要创建一个表包含自段image 和 type 类型各自为image 和 vnancharWebForm1.aspx%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="ReadAndWritePicFromDB.WebForm1" % !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" HTML HEAD titleW 阅读全文
posted @ 2004-10-26 19:01 leonardleonard 阅读(205) 评论(0) 推荐(0)
摘要: 作者:木子 http://blog.csdn.net/derny/下面利用ashx文件可以方便实现从数据库中读取图片并显示在datagrid当中//---------------------------------------BindImage.aspx ----------------------------------------%@ Page language="c#" Codebehind="BindImage.aspx.cs" AutoEventWireup="false" Inherits="ShowImage.BindImg" %HTMLHEADtitleBind 阅读全文
posted @ 2004-10-26 19:00 leonardleonard 阅读(125) 评论(0) 推荐(0)
摘要: Selecting, Confirming & Deleting Multiple Checkbox Items In A DataGrid (i.e. HotMail & Yahoo)IntroductionAlthough I don't have either a Hotmail or Yahoo email account, I do have friends that do, and I have often seen them check their e-mail and noticed how it was all neatly displayed in a table. Rig 阅读全文
posted @ 2004-10-26 18:53 leonardleonard 阅读(147) 评论(0) 推荐(0)
摘要: 作者:未知彩色图像转换为黑白图像时需要计算图像中每像素有效的亮度值,通过匹配像素亮度值可以轻松转换为黑白图像。计算像素有效的亮度值可以使用下面的公式:Y=0.3RED+0.59GREEN+0.11Blue然后使用 Color.FromArgb(Y,Y,Y) 来把计算后的值转换转换代码可以使用下面的方法来实现:[C#]publicBitmapConvertToGrayscale(Bitmapsource){Bitmapbm=newBitmap(source.Width,source.Height);for(inty=0;ybm.Height;y++){for(intx=0;xbm.Width 阅读全文
posted @ 2004-10-26 18:51 leonardleonard 阅读(294) 评论(0) 推荐(0)
摘要: 作者:未知文本的DES加密为了对称加密的安全,将密码进行封装,先新建一个用于保存密码的类库cl:using System;using System.Text ;namespace cl{/// summary/// Class1 的摘要说明。/// /summarypublic class Class1{public Class1(){}public string getiv(){string iv="********";//八位return iv;}public string getkey(){string key="01160129";//八位return key;}}}然后新建a 阅读全文
posted @ 2004-10-26 18:48 leonardleonard 阅读(205) 评论(0) 推荐(0)
摘要: 作者:http://blog.csdn.net/china2001ok/创建和写文本文件新建.aspx(主要是StreamWriter 和StreamReader )using System.IO ;//不可以少了private void Button1_Click(object sender, System.EventArgs e){StreamWriter sw;//调用File类的CreateText方法返回一个StreamWriter在创建StreamWriter之后,可以调用它的Write方法将文本写到文件中sw=File.CreateText (MapPath("ok.txt")) 阅读全文
posted @ 2004-10-26 18:46 leonardleonard 阅读(100) 评论(0) 推荐(0)