public dataset getdata(string httpurl) { string xmlpath = @"http地址"; // 该地址不能包含中文 dataset ds = new dataset(); webclient wc = new webclient(); byte[] bt = wc.downloaddata(xmlpath); xmldocument xd = new xmldocument(); string source = byte2string(bt); xd.loadxml(source); xmlnodereader xnr = new xmlnodereader(xd); ds.readxml(xnr); datatable dt = ds.tables[0]; this.datagrid1.datasource = ds; this.datag...
asp.net的缓存技术大大地提高了效率,本人将代码的简单的实现代码贴出:一、在页面中显示时,读缓存数据,加载xml数据public void loaddata() { dataview source = (dataview)cache["mydata"]; if(source == null) { dataset ds = new dataset(); filestream fs = new filestream(server.mappath("loginmsg.xml"), filemode.open,fileaccess.read); streamreader reader = new streamreader(fs); ds.readxml(reader); fs.close(); source = new dataview(ds.tables[0]); cache.insert(...
据说这个没有什么用,但是把这个搞懂了对datagri和datalist和有帮助,事业就笔记一下了。-控件清单 panel panel1; button button1; button button2; label label1; label label2; label label3; label label4; label label5; repeater repeater1;-.cs页private void page_load(object sender, system.eventargs e) { if(!this.ispostback) { this.label1.text="1"; this.fill(); } } private void fill() { int pag=convert.toint32(this.label1.text);//设置当前页 sqlconnecti...
映射xml文件书写如下<?xml version="1.0" encoding="utf-8" ?><sqlmap namespace="member" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="sqlmap.xsd"> <resultmaps> <resultmap id="selectresult" class="platadmin.model.member"> <result property="id" column="id" /> <result property="identityno" column="identityno" /> <result property="tele...
反向引用,指把匹配出来的组引用到表达式本身其它地方,比如,在匹配html的标记时,我们匹配出一个<a>,我们要把匹配出来的a引用出来,用来找到</a>,这个时候就要用到反向引用。 语法 a、反向引用编号的组,语法为number b、反向引用命名的组,语法为k<name> 举例 a、匹配成对的html标签 @"<(?<tag>[s>]+)[>]*>.*</k<tag>>" b、匹配两个两个重叠出现的字符 public static void main() { string s = "aabbc11asd"; regex reg = new regex(@"(w)1"); matchcollection matches = reg.matches(s); foreach(match m in matches) console.writeline(m.value);...
开始在网上查找到asp的无限分类,但是asp.net的几乎找不到,找到的也是跟treeview结合起来的.找到asp版本的代码有几种,原来都差不多是采用递归算法.其中表结构都是如下:表名称是classnameid 主键sid 对应的父类的idclassname 对应类别的名称.代码段一:1function loadnexttype(upid,rank)2 dim rs3 set rs="select * from classname where sid="&upid4 do while not rs.eof5 loadnexttype=loadnexttype &rs("classname")&"<br>"& string("-",rank) & loadnexttype(rs("id"),rank+1)6 rs.movenext7 lo...
下面的代码演示了如何对一段文本进行多关键字查询并高亮显示,给自己做为一个小tip保留下<%@ page language="c#" debug="false" strict="true" explicit="true" buffer="true"%><%@ import namespace="system" %><html><head><title></title></head><style type="text/css">.highlight {}{text-decoration:none; font-weight:bold; color:white; background:blue;}</style><body bgcolor="#ffffff" topmargin="0"...
应用程序更新的方法一般有两种:一是通知用户(比如发e-mail),让用户到指定的网站地址下载更新的程序;二是将更新的职责从用户那边转移到应用程序自身,由应用程序自身取代用户获取并安装一个软件的更新,客户端应用程序自身负责从一个已知服务器下载并安装更新,用户唯一需要进行干预的是决定是否愿意现在或以后安装新的更新。显然,后者比前者更友好。你现在可以看到类似后一种方法的实际产品,比如windows xp和microsoft money。本文所介绍的.net应用程序更新组件就可以提供类似的功能。 一、.net应用程序更新组件介绍 .net 应用程序更新组件appupdater 是使用.net框架开发的。尽管appupdater 不是微软的产品,但是只要你在vs.net工具栏中添加了该组件,就可以象使用其它组件一样通过拖拽的方式将该组件从工具栏中拖放到你的应用程序中,并设置一些属性(比如获取更新的位...
1.确认有效电子邮件格式 下面的代码示例使用静态 regex.ismatch 方法验证一个字符串是否为有效电子邮件格式。如果字符串包含一个有效的电子邮件地址,则 isvalidemail 方法返回 true,否则返回 false,但不采取其他任何操作。您可以使用 isvalidemail,在应用程序将地址存储在数据库中或显示在 asp.net 页中之前,筛选出包含无效字符的电子邮件地址。 [visual basic] function isvalidemail(strin as string) as boolean ' return true if strin is in valid e-mail format. return regex.ismatch(strin, ("([w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)((...
正则表达式中的组是很重要的一个概念,它是我们通向高级正则应用的的桥梁。 组的概念 一个正则表达式匹配结果可以分成多个部分,这就是组(group)的目的。能够灵活的使用组后,你会发现regex真是很方便,也很强大。 先举个例子 public static void main() { string s = "2005-2-21"; regex reg = new regex(@"(?<y>d{4})-(?<m>d{1,2})-(?<d>d{1,2})",regexoptions.compiled); match match = reg.match(s); int year = int.parse(match.groups["y"].value); int month = int.parse(match.groups["m"].value...
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器