<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[聊设计|MyStudio Blog - Coding]]></title>
<link>https://blog.imwebs.com/</link>
<description><![CDATA[网站设计建设-平面设计-编程学习]]></description>
<language>zh-cn</language>
<copyright><![CDATA[Copyright 2005 PBlog3 v2.8]]></copyright>
<webMaster><![CDATA[webmaster@imwebs.com(Jiexu)]]></webMaster>
<generator>PBlog2 v2.4</generator> 
<image>
	<title>聊设计|MyStudio Blog</title>
	<url>https://blog.imwebs.com/images/logos.gif</url>
	<link>https://blog.imwebs.com/</link>
	<description>聊设计|MyStudio Blog</description>
</image>

			<item>
			<link>https://blog.imwebs.com/article.asp?id=649</link>
			<title><![CDATA[常用ActionScript（AS3）功能实现]]></title>
			<author>webmaster@imwebs.com(parno)</author>
			<category><![CDATA[Coding]]></category>
			<pubDate>Sat,20 Feb 2021 11:00:59 +0800</pubDate>
			<guid>https://blog.imwebs.com/default.asp?id=649</guid>
		<description><![CDATA[### 元件过渡效果<br/><br/>```javascri&#112;t<br/>import fl.transitions.*;<br/>import fl.transitions.easing.*;<br/><br/>TransitionManager.start(play_mc, {<br/>&#160;&#160;&#160;&#160;type: Fade,<br/>&#160;&#160;&#160;&#160;direction: Transition.OUT,<br/>&#160;&#160;&#160;&#160;duration: 0.2,<br/>&#160;&#160;&#160;&#160;easing: None.easeNone<br/>});&#160;&#160;&#160;&#160;<br/>```<br/><br/>---<br/><br/>### 舞台全局属性设置<br/><br/>```javascri&#112;t<br/>stage.displayState = StageDisplayState.FULL_SCREEN;&#160;&#160;&#160;&#160;//全屏显示<br/>stage.scaleMode = StageScaleMode.EXACT_FIT;&#160;&#160;&#160;&#160;//锁定比例显示<br/>stage.addEventListener(MouseEvent.RIGHT_CLICK,function(e:MouseEvent):void{});&#160;&#160;&#160;&#160;//屏蔽右键<br/>```<br/><br/>---<br/><br/>### 生成事件监听<br/><br/>```javascri&#112;t<br/>v0_btn.addEventListener(MouseEvent.CLICK, v_btn_click);<br/><br/>function v_btn_click(event: MouseEvent): void {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//trace(event)&#160;&#160;&#160;&#160;<br/>}<br/>```<br/><br/>##### 常用动作库<br/><br/>&gt; **import flash.events.Event;**<br/>&gt;<br/>&gt; &gt; MouseEvent.CLICK<br/>&gt; &gt; MouseEvent.MOUSE_MOVE<br/>&gt;<br/>&gt; **import fl.video.VideoEvent;**<br/>&gt;<br/>&gt; &gt; Event.COMPLETE<br/><br/>---<br/><br/>### 元件属性<br/><br/>```javascri&#112;t<br/>play_mc.x = 0<br/>play_mc.y = 0<br/>play_mc.width = 0<br/>play_mc.height = 0<br/>play_mc.visible = true | false<br/>play_mc.alpha=0.1;<br/>```<br/><br/>---<br/><br/>### 音乐播放代码<br/><br/>```javascri&#112;t<br/>import flash.net.URLRequest;<br/>import flash.media.Sound;<br/>import flash.media.SoundChannel;<br/><br/>var req:URLRequest = new URLRequest(&#34;音乐.mp3&#34;);<br/>var snd:Sound = new Sound();<br/>var channel:SoundChannel = new SoundChannel();<br/>snd.load(req);<br/>channel=snd.play(0); | channel.stop();<br/>```<br/><br/>---<br/><br/>### 定时器<br/><br/>```javascri&#112;t<br/>import flash.events.TimerEvent;<br/>import flash.utils.Timer;<br/><br/>var myTimer:Timer=new Timer(1000,0);&#160;&#160;&#160;&#160;//操作间隔1秒，重复次数无限（24.86天）<br/>myTimer.addEventListener(&#34;timer&#34;, timerhandler);&#160;&#160;&#160;&#160;//注意，事件timer必须全部小写<br/>myTimer.start();<br/>myTimer.stop();<br/>```<br/><br/>---<br/><br/>### FLVPlayback 播放器<br/><br/>```javascri&#112;t<br/>import fl.video.FLVPlayback;<br/>play_mc.player.source = url;<br/>play_mc.player.autoRewind=true;&#160;&#160;&#160;&#160;//播放停止時倒帶到「影格 1」<br/>play_mc.player.getVideoPlayer(play_mc.player.activeVideoPlayerIndex).smoothing = true;&#160;&#160;&#160;&#160;//平滑视频<br/>play_mc.player.volume = 80;<br/>play_mc.player.play();<br/>```<br/><br/>]]></description>
		</item>
		
			<item>
			<link>https://blog.imwebs.com/article.asp?id=643</link>
			<title><![CDATA[为EXE创建自签名的证书]]></title>
			<author>webmaster@imwebs.com(parno)</author>
			<category><![CDATA[Coding]]></category>
			<pubDate>Tue,21 Jan 2020 23:50:56 +0800</pubDate>
			<guid>https://blog.imwebs.com/default.asp?id=643</guid>
		<description><![CDATA[安装了Windows SDK 或者安装 VS 使用 VS 的命令行都可以：<br/><br/>1.创建自签名的证书和公钥<br/>makecert -r -sv MyStudio_key.pvk -n &#34;CN=YourStudioName,E=Email,C=China,S=Jiangsu&#34; MyStudio.cer<br/><br/>2.生成发行者证书<br/>cert2spc MyStudio.cer MyStudio.spc<br/><br/>3.生成PFX格式的证书<br/>pvk2pfx -pvk MyStudio_key.pvk –pi password -spc MyStudio.spc -pfx MyStudio.pfx –po password<br/><br/>4.使用pfx格式的证书对可执行文件进行签名<br/>signtool&nbsp;&nbsp;sign&nbsp;&nbsp;/f&nbsp;&nbsp;MyStudio.pfx /p password&nbsp;&nbsp;*.exe<br/><br/>签名完成之后，查看执行性文件的属性即可看到签名的信息了。]]></description>
		</item>
		
			<item>
			<link>https://blog.imwebs.com/article.asp?id=626</link>
			<title><![CDATA[增量更新方案]]></title>
			<author>webmaster@imwebs.com(parno)</author>
			<category><![CDATA[Coding]]></category>
			<pubDate>Wed,12 Sep 2018 21:24:18 +0800</pubDate>
			<guid>https://blog.imwebs.com/default.asp?id=626</guid>
		<description><![CDATA[对比就是客户端请求服务端所有关键数据，跟本地已有的数据进行对比，筛选出增删改的数据进行更新。<br/><br/>用对比方法的好处是服务端什么都不用做，坏处是客户端逻辑复杂，耗网络流量。在这种方案里，数据的新增和删除很容易判断，根据客户端数据的id列表和服务端数据的id列表进行对比就行，若要判断哪个数据有修改则比较麻烦，需要取回数据进行对比，如果从服务端拉回所有对所有数据进行对比会很耗网络流量，有一个优化方式，就是对每个数据的修改进行标记。<br/>以日历为例，一个日历可修改的字段很多，例如时间段，内容，邀请人等，全部拉回来对比不现实，对此可以在服务端给每个日历事件新增一个字段tag，表示这个日历事件的版本，服务端更新一个日历事件时会同时更新这个tag，客户端只需要取回每个id对应的tag，跟本地保存的tag对比，不一致表示这个日历事件已经更新，再去获取日历实体就完成更新了。<br/><br/>若服务端因为某些原因无法给每个数据保存一个版本标记，可以实时计算，在客户端和服务端约定一个算法，把所有可变参数拿出来，通过特定算法hash出一个值，对比这个hash值判断是否需要更新。<br/><br/>邮件协议IMAP，日历协议CalDAV就是用这种方式做增量更新，IMAP并没有做上述的优化，在判断邮件有没有更新时只能乖乖把所有数据请求回来对比，数据是XML，算是相当低效的协议。CalDAV给每个日历事件加了上述的tag，直接对比即可知道是否需要更新。]]></description>
		</item>
		
			<item>
			<link>https://blog.imwebs.com/article.asp?id=616</link>
			<title><![CDATA[Javascri&#112;t 产生指定范围的随机数]]></title>
			<author>webmaster@imwebs.com(parno)</author>
			<category><![CDATA[Coding]]></category>
			<pubDate>Thu,17 Jul 2014 10:21:23 +0800</pubDate>
			<guid>https://blog.imwebs.com/default.asp?id=616</guid>
		<description><![CDATA[<div class="UBBPanel"><div class="UBBTitle"><img src="https://blog.imwebs.com/images/html.gif" style="margin:0px 2px -3px 0px"> HTML代码</div><div class="UBBContent"><TEXTAREA rows="8" id="temp36536"><script type=&#34;text/javascri&#112;t&#34;>

//产生 x-y 内随机数
//document.write(Math.random()*(y-x)+x);

// 产生 1-5 内随机数
document.write(Math.random()*(5-1)+1);

document.write(&#34;<br>&#34;);

//产生1-5（含）内随机数并取整
document.write(Math.round(Math.random()*(5-1)+1));

</script></TEXTAREA><br/><INPUT onclick="runEx('temp36536')"  type="button" class="userbutton" value="运行此代码"/> <INPUT onclick="doCopy('temp36536')"  type="button" class="userbutton" value="复制此代码"/> <INPUT onclick="saveCode('temp36536')" type="button" class="userbutton" value="保存此代码"><br/> [Ctrl+A 全部选择 提示：你可先修改部分代码，再按运行]</div></div>]]></description>
		</item>
		
			<item>
			<link>https://blog.imwebs.com/article.asp?id=612</link>
			<title><![CDATA[毫米、缇和英寸的单位换算]]></title>
			<author>webmaster@imwebs.com(parno)</author>
			<category><![CDATA[Coding]]></category>
			<pubDate>Sat,07 Dec 2013 09:42:55 +0800</pubDate>
			<guid>https://blog.imwebs.com/default.asp?id=612</guid>
		<description><![CDATA[1英寸=1440twip<br/>1毫米=56.47twip <br/><br/>那么 1毫米 = 56.47/1440 = 0.0392 英寸]]></description>
		</item>
		
			<item>
			<link>https://blog.imwebs.com/article.asp?id=597</link>
			<title><![CDATA[ADODB.Stream 写文本文件相关的 ASP 函数]]></title>
			<author>webmaster@imwebs.com(parno)</author>
			<category><![CDATA[Coding]]></category>
			<pubDate>Fri,18 Jan 2013 14:55:24 +0800</pubDate>
			<guid>https://blog.imwebs.com/default.asp?id=597</guid>
		<description><![CDATA[<div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code28250);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="https://blog.imwebs.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code28250>&lt;%<br/>&#39;================================================<br/>&#39;函数名：Cr&#101;atedTextFile<br/>&#39;作 用：创建文本文件<br/>&#39;参 数：FileName <br/>&#39;================================================<br/>Public Function Cr&#101;atedTextFile(ByVal FileName, ByVal body)<br/>On Error Resume Next<br/>If InStr(FileName, &#34;:&#34;) = 0 Then FileName = Server.MapPath(FileName)<br/>Dim oStream<br/>Set oStream = Cr&#101;ateObject(&#34;ADODB.Stream&#34;)<br/>oStream.Type = 2 &#39;设置为可读可写<br/>oStream.Mode = 3 &#39;设置内容为文本<br/>oStream.Charset = &#34;UTF-8&#34; &#39;设置编码<br/>oStream.Open<br/>oStream.Position = oStream.Size<br/>oStream.WriteText body<br/>oStream.SaveToFile FileName, 2<br/>oStream.Close<br/>Set oStream = Nothing<br/>If Err.Number &lt;&gt; 0 Then Err.Clear<br/>End Function<br/><br/>&#39;================================================<br/>&#39;函数名：Readfile<br/>&#39;作 用：读取文件内容<br/>&#39;参 数：fromPath —-来源文件路径<br/>&#39;================================================<br/>Public Function Readfile(ByVal fromPath)<br/>On Error Resume Next<br/>Dim strTemp,fso,f<br/>If InStr(fromPath, &#34;:&#34;) = 0 Then fromPath = Server.MapPath(fromPath)<br/>Set fso = Server.Cr&#101;ateObject(FSO_ScriptName)<br/>If fso.FileExists(fromPath) Then<br/>Set f = fso.OpenTextFile(fromPath, 1, True)<br/>strTemp = f.ReadAll<br/>f.Close<br/>Set f = Nothing<br/>End If<br/>Set fso = Nothing<br/>Readfile = strTemp<br/>If Err.Number &lt;&gt; 0 Then Err.Clear<br/>End Function<br/>&#39;================================================<br/>%&gt;</div></div>]]></description>
		</item>
		
			<item>
			<link>https://blog.imwebs.com/article.asp?id=587</link>
			<title><![CDATA[ASP 写入 UTF-8 BOM 签名]]></title>
			<author>webmaster@imwebs.com(parno)</author>
			<category><![CDATA[Coding]]></category>
			<pubDate>Tue,07 Aug 2012 16:01:20 +0800</pubDate>
			<guid>https://blog.imwebs.com/default.asp?id=587</guid>
		<description><![CDATA[使用 ASP 导出 CSV 文件，ASP 采用 UTF-8 编码，而生成的 CSV 文件因为没有包含 BOM 签名而不被 Excel 2003 识别，因此显示乱码。<br/><br/>BOM 签名为 0xEF 0xBB 0xBF 三个字节，使用 ASP 输出方法如下：<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code6224);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="https://blog.imwebs.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code6224>Response.BinaryWrite(chrb(239))<br/>Response.BinaryWrite(chrb(187))<br/>Response.BinaryWrite(chrb(191))</div></div><br/><br/>按此可解决 CSV 文件在 Excel 2003 出现乱码的问题。]]></description>
		</item>
		
			<item>
			<link>https://blog.imwebs.com/article.asp?id=583</link>
			<title><![CDATA[C# 常用函数、正则表达式]]></title>
			<author>webmaster@imwebs.com(parno)</author>
			<category><![CDATA[Coding]]></category>
			<pubDate>Wed,28 Mar 2012 22:37:03 +0800</pubDate>
			<guid>https://blog.imwebs.com/default.asp?id=583</guid>
		<description><![CDATA[<strong>常用函数</strong><br/><br/><span style="color:red">1、DateTime 数字型</span> <br/>System.DateTime currentTime=new System.DateTime(); <br/>1.1 取当前年月日时分秒 <br/>currentTime=System.DateTime.Now; <br/>1.2 取当前年 <br/>int 年=currentTime.Year; <br/>1.3 取当前月 <br/>int 月=currentTime.Month; <br/>1.4 取当前日 <br/>int 日=currentTime.Day; <br/>1.5 取当前时 <br/>int 时=currentTime.Hour; <br/>1.6 取当前分 <br/>int 分=currentTime.Minute; <br/>1.7 取当前秒 <br/>int 秒=currentTime.Second; <br/>1.8 取当前毫秒 <br/>int 毫秒=currentTime.Millisecond; //（变量可用中文） <br/>1.9 取中文日期显示——年月日时分 <br/>string strY=currentTime.ToString(&#34;f&#34;); //不显示秒 <br/>1.10 取中文日期显示_年月 <br/>string strYM=currentTime.ToString(&#34;y&#34;); <br/>1.11 取中文日期显示_月日 <br/>string strMD=currentTime.ToString(&#34;m&#34;); <br/>1.12 取当前年月日，格式为：2003-9-23 <br/>string strYMD=currentTime.ToString(&#34;d&#34;); <br/>1.13 取当前时分，格式为：14：24 <br/>string strT=currentTime.ToString(&#34;t&#34;); <br/><br/><span style="color:red">2、Int32.Parse(变量) Int32.Parse(&#34;常量&#34;) </span> <br/>字符型转换 转为32位数字型 <br/><br/><span style="color:red">3、 变量.ToString() </span> <br/>字符型转换 转为字符串 <br/>12345.ToString(&#34;n&#34;); //生成 12,345.00 <br/>12345.ToString(&#34;C&#34;); //生成 ￥12,345.00 <br/>12345.ToString(&#34;e&#34;); //生成 1.234500e+004 <br/>12345.ToString(&#34;f4&#34;); //生成 12345.0000 <br/>12345.ToString(&#34;x&#34;); //生成 3039 (16进制) <br/>12345.ToString(&#34;p&#34;); //生成 1,234,500.00% <br/><br/><span style="color:red">4、变量.Length 数字型 </span> <br/>取字串长度： <br/>如： string str=&#34;中国&#34;; <br/>int Len = str.Length ; //Len是自定义变量， str是求测的字串的变量名 <br/><br/><span style="color:red">5、System.Text.Encoding.Default.GetBytes(变量) </span> <br/>字码转换 转为比特码 <br/>如：byte[] bytStr = System.Text.Encoding.Default.GetBytes(str); <br/>然后可得到比特长度： <br/>len = bytStr.Length; <br/><br/><span style="color:red">6、System.Text.StringBuilder(&#34;&#34;) </span> <br/>字符串相加，（+号是不是也一样？） <br/>如：System.Text.StringBuilder sb = new System.Text.StringBuilder(&#34;&#34;); <br/>sb.Append(&#34;中华&#34;); <br/>sb.Append(&#34;人民&#34;); <br/>sb.Append(&#34;共和国&#34;); <br/><br/><span style="color:red">7、变量.Substring(参数1,参数2); </span> <br/>截取字串的一部分，参数1为左起始位数，参数2为截取几位。 <br/>如：string s1 = str.Substring(0,2); <br/><br/><span style="color:red">8、String user_IP=Request.ServerVariables[&#34;REMOTE_ADDR&#34;].ToString(); </span> <br/>取远程用户IP地址 <br/><br/><span style="color:red">9、穿过代理服务器取远程用户真实IP地址： </span> <br/>if(Request.ServerVariables[&#34;HTTP_VIA&#34;]!=null){ <br/>string user_IP=Request.ServerVariables[&#34;HTTP_X_FORWARDED_FOR&#34;].ToString(); <br/>}else{ <br/>string user_IP=Request.ServerVariables[&#34;REMOTE_ADDR&#34;].ToString(); <br/>} <br/><br/><span style="color:red">10、 Session[&#34;变量&#34;]; </span> <br/>存取Session值； <br/>如，赋值： Session[&#34;username&#34;]=&#34;小布什&#34;; <br/><br/>取值： Object objName=Session[&#34;username&#34;]; <br/>String strName=objName.ToString(); <br/>清空： Session.RemoveAll(); <br/><br/><span style="color:red">11、String str=Request.QueryString[&#34;变量&#34;]; </span> <br/>用超链接传送变量。 <br/>如在任一页中建超链接:&lt;a href=Edit.aspx?fbid=23&gt;点击&lt;/a&gt; <br/>在Edit.aspx页中取值：String str=Request.QueryString[&#34;fdid&#34;]; <br/><br/><span style="color:red">12、DOC对象.Cr&#101;ateElement(&#34;新建节点名&#34;); </span> <br/>创建XML文档新节点 <br/><br/><span style="color:red">13、父节点.AppendChild(子节点)； </span> <br/>将新建的子节点加到XML文档父节点下 <br/><br/><span style="color:red">14、 父节点.RemoveChild(节点); </span> <br/>删除节点 <br/><br/><span style="color:red">15、Response </span> <br/>Response.Write(&#34;字串&#34;)； <br/>Response.Write(变量)； <br/>向页面输出。 <br/><br/>Response.Redirect(&#34;URL地址&#34;）； <br/>跳转到URL指定的页面 <br/><br/><span style="color:red">16、char.IsWhiteSpce(字串变量，位数)——逻辑型 </span> <br/>查指定位置是否空字符； <br/>如： <br/>string str=&#34;中国 人民&#34;; <br/>Response.Write(char.IsWhiteSpace(str,2)); //结果为：True, 第一个字符是0位，2是第三个字符。 <br/><br/><span style="color:red">17、char.IsPunctuation(&#39;字符&#39;) --逻辑型 </span> <br/>查字符是否是标点符号 <br/>如：Response.Write(char.IsPunctuation(&#39;A&#39;)); //返回：False <br/><br/><span style="color:red">18、(int)&#39;字符&#39; </span> <br/>把字符转为数字，查代码点，注意是单引号。 <br/>如： <br/>Response.Write((int)&#39;中&#39;); //结果为中字的代码：20013 <br/><br/><span style="color:red">19、(char)代码 </span> <br/>把数字转为字符，查代码代表的字符。 <br/>如： <br/>Response.Write((char)22269); //返回“国”字。 <br/><br/><span style="color:red">20、 Trim() </span> <br/>清除字串前后空格 <br/><br/><span style="color:red">21 、字串变量.Replace(&#34;子字串&#34;,&#34;替换为&#34;) </span> <br/>字串替换 <br/>如： <br/>string str=&#34;中国&#34;; <br/>str=str.Replace(&#34;国&#34;,&#34;央&#34;); //将国字换为央字 <br/>Response.Write(str); //输出结果为“中央” <br/><br/>再如：（这个非常实用） <br/><br/>string str=&#34;这是&lt;script&gt;脚本&#34;; <br/>str=str.Replace(&#34;&lt;&#34;,&#34;&lt;font&gt;&lt;&lt;/font&gt;&#34;); //将左尖括号替换为&lt;font&gt; 与 &lt; 与 &lt;/font&gt; （或换为&lt;，但估计经XML存诸后，再提出仍会还原） <br/>Response.Write(str); //显示为：“这是&lt;script&gt;脚本” <br/><br/>如果不替换，&lt;script&gt;将不显示，如果是一段脚本，将运行；而替换后，脚本将不运行。 <br/>这段代码的价值在于：你可以让一个文本中的所有HTML标签失效，全部显示出来，保护你的具有交互性的站点。 <br/>具体实现：将你的表单提交按钮脚本加上下面代码： <br/>string strSubmit=label1.Text; //label1是你让用户提交数据的控件ID。 <br/>strSubmit=strSubmit.Replace(&#34;&lt;&#34;,&#34;&lt;font&gt;&lt;&lt;/font&gt;&#34;); <br/>然后保存或输出strSubmit。 <br/>用此方法还可以简单实现UBB代码。 <br/><br/><span style="color:red">22、Math.Max(i,j) </span> <br/>取i与j中的最大值 <br/>如 int x=Math.Max(5,10); // x将取值 10 <br/><br/><span style="color:red">23、字串对比一般都用: if(str1==str2){ } </span> , 但还有别的方法: <br/><br/>(1)、 <br/>string str1; str2 <br/>//语法: str1.EndsWith(str2); __检测字串str1是否以字串str2结尾,返回布尔值.如: <br/>if(str1.EndsWith(str2)){ Response.Write(&#34;字串str1是以&#34;+str2+&#34;结束的&#34;); } <br/><br/>(2)、 <br/>//语法:str1.Equals(str2); __检测字串str1是否与字串str2相等,返回布尔值,用法同上. <br/><br/>(3)、 <br/>//语法 Equals(str1,str2); __检测字串str1是否与字串str2相等,返回布尔值,用法同上. <br/><br/><span style="color:red">24、IndexOf() 、LastIndexOf() </span> <br/>查找字串中指定字符或字串首次（最后一次）出现的位置,返回索引值，如： <br/>str1.IndexOf(&#34;字&#34;)； //查找“字”在str1中的索引值（位置） <br/>str1.IndexOf(&#34;字串&#34;)；//查找“字串”的第一个字符在str1中的索引值（位置） <br/>str1.IndexOf(&#34;字串&#34;,3,2)；//从str1第4个字符起，查找2个字符，查找“字串”的第一个字符在str1中的索引值（位置） <br/><br/><span style="color:red">25、Ins&#101;rt() </span> <br/>在字串中指定索引位插入指定字符。如： <br/>str1.Ins&#101;rt(1,&#34;字&#34;);在str1的第二个字符处插入“字”，如果str1=&#34;中国&#34;，插入后为“中字国”； <br/><br/><span style="color:red">26、PadLeft()、PadRight() </span> <br/>在字串左（或右）加空格或指定char字符，使字串达到指定长度，如： <br/>&lt;% <br/>string str1=&#34;中国人&#34;; <br/>str1=str1.PadLeft(10,&#39;1&#39;); //无第二参数为加空格 <br/>Response.Write(str1); //结果为“1111111中国人” ， 字串长为10 <br/>%&gt; <br/><br/><span style="color:red">27、Remove() </span> <br/>从指定位置开始删除指定数的字符 <br/><br/><br/><strong>常用正则表达式</strong><br/>[中国自学编程网整理发布]<br/><br/>这是我发了不少时间整理的C#的正则表达式，新手朋友注意一定要手册一下哦，这样可以节省很多写代码的时间<br/><br/>只能输入数字：&#34;^[0-9]*$&#34;<br/><br/>只能输入n位的数字：&#34;^\d{n}$&#34;<br/><br/>只能输入至少n位的数字：&#34;^\d{n,}$&#34;<br/><br/>只能输入m~n位的数字：&#34;^\d{m,n}$&#34;<br/><br/>只能输入零和非零开头的数字：&#34;^(0|[1-9][0-9]*)$&#34;<br/><br/>只能输入有两位小数的正实数：&#34;^[0-9]+(.[0-9]{2})?$&#34;<br/><br/>只能输入有1~3位小数的正实数：&#34;^[0-9]+(.[0-9]{1,3})?$&#34;<br/><br/>只能输入非零的正整数：&#34;^\+?[1-9][0-9]*$&#34;<br/><br/>只能输入非零的负整数：&#34;^\-[1-9][]0-9&#34;*$<br/><br/>只能输入长度为3的字符：&#34;^.{3}$&#34;<br/><br/>只能输入由26个英文字母组成的字符串：&#34;^[A-Za-z]+$&#34;<br/><br/>只能输入由26个大写英文字母组成的字符串：&#34;^[A-Z]+$&#34;<br/><br/>只能输入由26个小写英文字母组成的字符串：&#34;^[a-z]+$&#34;<br/><br/>只能输入由数字和26个英文字母组成的字符串：&#34;^[A-Za-z0-9]+$&#34;<br/><br/>只能输入由数字、26个英文字母或者下划线组成的字符串：&#34;^\w+$&#34;<br/><br/>验证用户密码：&#34;^[a-zA-Z]\w{5,17}$&#34;正确格式为：以字母开头，长度在6~18之间，只能包含字符、数字和下划线<br/><br/>验证是否含有^%&amp;&#39;,;=?$\&#34;等字符：&#34;[^%&amp;&#39;,;=?$\x22]+&#34;<br/><br/>只能输入汉字：&#34;^[\u4e00-\u9fa5]{0,}$&#34;<br/><br/>验证Email地址：&#34;^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$&#34;<br/><br/>验证InternetURL：&#34;^<a href="http://" target="_blank" rel="external">http://</a>([\w-]+\.)+[\w-]+(/[\w-./?%&amp;=]*)?$&#34;<br/><br/>验证电话号码：&#34;^(\(\d{3,4}-)|\d{3.4}-)?\d{7,8}$&#34;正确格式为：&#34;XXX-XXXXXXX&#34;、&#34;XXXX-XXXXXXXX&#34;、&#34;XXX-XXXXXXX&#34;、&#34;XXX-XXXXXXXX&#34;、&#34;XXXXXXX&#34;和&#34;XXXXXXXX&#34;<br/><br/>验证身份证号(15位或18位数字)：&#34;^\d{15}|\d{18}$&#34;<br/><br/>验证一年的12个月：&#34;^(0?[1-9]|1[0-2])$&#34;正确格式为：&#34;01&#34;～&#34;09&#34;和&#34;1&#34;～&#34;12&#34;<br/><br/>验证一个月的31天：&#34;^((0?[1-9])|((1|2)[0-9])|30|31)$&#34;正确格式为;&#34;01&#34;～&#34;09&#34;和&#34;1&#34;～&#34;31&#34;<br/><br/>利用正则表达式限制网页表单里的文本框输入内容：<br/>用正则表达式限制只能输入中文：onkeyup=&#34;value=value.replace(/[^\u4E00-\u9FA5]/g,&#39;&#39;)&#34; onbeforepaste=&#34;clipboardData.setData(&#39;text&#39;,clipboardData.getData(&#39;text&#39;).replace(/[^\u4E00-\u9FA5]/g,&#39;&#39;))&#34;<br/><br/>用正则表达式限制只能输入全角字符： onkeyup=&#34;value=value.replace(/[^\uFF00-\uFFFF]/g,&#39;&#39;)&#34; onbeforepaste=&#34;clipboardData.setData(&#39;text&#39;,clipboardData.getData(&#39;text&#39;).replace(/[^\uFF00-\uFFFF]/g,&#39;&#39;))&#34;<br/><br/>用正则表达式限制只能输入数字：onkeyup=&#34;value=value.replace(/[^\d]/g,&#39;&#39;) &#34;onbeforepaste=&#34;clipboardData.setData(&#39;text&#39;,clipboardData.getData(&#39;text&#39;).replace(/[^\d]/g,&#39;&#39;))&#34;<br/><br/>用正则表达式限制只能输入数字和英文：onkeyup=&#34;value=value.replace(/[\W]/g,&#39;&#39;) &#34;onbeforepaste=&#34;clipboardData.setData(&#39;text&#39;,clipboardData.getData(&#39;text&#39;).replace(/[^\d]/g,&#39;&#39;))&#34;<br/><br/>得用正则表达式从URL地址中提取文件名的javascri&#112;t程序，如下结果为page1<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code92629);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="https://blog.imwebs.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code92629>s=&#34;<a href="http://www.9499.net/page1.htm" target="_blank" rel="external">http://www.9499.net/page1.htm</a>&#34; <br/>s=s.replace(/(.*\/){0,}([^\.]+).*/ig,&#34;$2&#34;) <br/>alert(s)</div></div><br/><br/>匹配双字节字符(包括汉字在内)：[^\x00-\xff]<br/>应用：计算字符串的长度(一个双字节字符长度计2，ASCII字符计1)<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code74066);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="https://blog.imwebs.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code74066>String.prototype.len=function(){return this.replace([^\x00-\xff]/g,&#34;aa&#34;).length;}</div></div><br/><br/>匹配空行的正则表达式：\n[\s| ]*\r<br/><br/>匹配HTML标记的正则表达式：/&lt;(.*)&gt;.*&lt;\/\1&gt;|&lt;(.*) \/&gt;/<br/><br/>匹配首尾空格的正则表达式：(^\s*)|(\s*$)<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code56313);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="https://blog.imwebs.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code56313>String.prototype.trim = function() <br/>{ <br/>return this.replace(/(^\s*)|(\s*$)/g, &#34;&#34;); <br/>}</div></div><br/><br/>利用正则表达式分解和转换IP地址：<br/>下面是利用正则表达式匹配IP地址，并将IP地址转换成对应数值的Javascri&#112;t程序：<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code83016);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="https://blog.imwebs.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code83016>function IP2V(ip) <br/>{ <br/>re=/(\d+)\.(\d+)\.(\d+)\.(\d+)/g //匹配IP地址的正则表达式 <br/>if(re.test(ip)) <br/>{ <br/>return RegExp.$1*Math.pow(255,3))+RegExp.$2*Math.pow(255,2))+RegExp.$3*255+RegExp.$4*1 <br/>} <br/>else <br/>{ <br/>throw new Error(&#34;Not a valid IP address!&#34;) <br/>} <br/>}</div></div>]]></description>
		</item>
		
			<item>
			<link>https://blog.imwebs.com/article.asp?id=582</link>
			<title><![CDATA[Excel VBA 了解这点，做任何事]]></title>
			<author>webmaster@imwebs.com(parno)</author>
			<category><![CDATA[Coding]]></category>
			<pubDate>Tue,27 Mar 2012 16:30:55 +0800</pubDate>
			<guid>https://blog.imwebs.com/default.asp?id=582</guid>
		<description><![CDATA[&#39;<span style="color:red">Workbook 对象</span>：Microsoft Excel 工作簿对象，可以看成当前打开的 Excel 文件<br/>&#39;可以使用 Application 对象的 ActiveWorkbook 属性得到当前工作簿实例。<br/><br/>&#39;<span style="color:red">Worksheet 对象</span>：工作表对象，是Worksheets 集合的成员<br/>&#39;可以使用 Worksheet 对象的 ActiveSheet 属性得到当前工作表实例。<br/><br/>&#39;那么，试试获取当前工作簿的名称吧，应该会返回“Sheet1”<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code74717);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="https://blog.imwebs.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code74717>Sub TestWooksheetName()<br/><br/>Dim myWorkBook As Workbook<br/>Dim mySheet As Worksheet<br/><br/>Set myWorkBook = Application.ActiveWorkbook<br/>Set mySheet = myWorkBook.ActiveSheet<br/><br/>Debug.Print mySheet.Name<br/><br/>End Sub</div></div><br/><br/>&#39;<span style="color:red">Cells 属性</span>：Worksheet 对象的属性，表示工作表所有单元格<br/>&#39;它像一个二维数组，第一维是工作表行位置，第二维是工作表列位置，<br/>&#39;例如，取得工作表第一行第一列单元格表示为 Cells(1,1)<br/><br/>&#39;遍历工作表第一列的所有内容及第一行的所有内容<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code41605);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="https://blog.imwebs.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code41605>Sub TestListColumns()<br/><br/>Dim myWorkBook As Workbook<br/>Dim mySheet As Worksheet<br/><br/>Set myWorkBook = Application.ActiveWorkbook<br/>Set mySheet = myWorkBook.ActiveSheet<br/><br/>Dim i As Long<br/><br/>&#39;遍历工作表第一列的所有内容<br/>For i = 1 To mySheet.Cells.Count<br/>&nbsp;&nbsp;&nbsp;&nbsp;If Len(mySheet.Cells(i, 1)) = 0 Then Exit For&nbsp;&nbsp; &#39;如果单元格为空则跳出循环<br/>&nbsp;&nbsp;&nbsp;&nbsp;Debug.Print mySheet.Cells(i, 1)<br/>Next i<br/><br/>&#39;遍历工作表第一行的所有内容<br/>For i = 1 To mySheet.Cells.Count<br/>&nbsp;&nbsp;&nbsp;&nbsp;If Len(mySheet.Cells(1, i)) = 0 Then Exit For&nbsp;&nbsp; &#39;如果单元格为空则跳出循环<br/>&nbsp;&nbsp;&nbsp;&nbsp;Debug.Print mySheet.Cells(1, i)<br/>Next i<br/><br/>End Sub</div></div><br/><br/>&#39;上例中用 Cells.Count 取得了工作表所有的单元格，是一个比较大的数值。<br/>&#39;如果你想深入学习 Excel VBA 可能要去了解一下 Worksheet.UsedRange 对象的 Columns 属性和 Rows 属性，<br/>&#39;但仅是知道上面这些，只要你了解 VBscri&#112;t 我觉得可以做任何事情了。]]></description>
		</item>
		
			<item>
			<link>https://blog.imwebs.com/article.asp?id=569</link>
			<title><![CDATA[删除 SQL Server 2000 的危险扩展]]></title>
			<author>webmaster@imwebs.com(parno)</author>
			<category><![CDATA[Coding]]></category>
			<pubDate>Tue,26 Jul 2011 11:29:56 +0800</pubDate>
			<guid>https://blog.imwebs.com/default.asp?id=569</guid>
		<description><![CDATA[使用系统帐户登陆查询分析器，然后运行下面的脚本:<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code40941);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="https://blog.imwebs.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code40941>use master <br/>exec sp_dro&#112;extendedproc &#39;xp_cmdshell&#39; <br/>exec sp_dro&#112;extendedproc &#39;xp_dirtree&#39;<br/>exec sp_dro&#112;extendedproc &#39;xp_enumgroups&#39;<br/>exec sp_dro&#112;extendedproc &#39;xp_fixeddrives&#39;<br/>exec sp_dro&#112;extendedproc &#39;xp_loginconfig&#39;<br/>exec sp_dro&#112;extendedproc &#39;xp_enumerrorlogs&#39;<br/>exec sp_dro&#112;extendedproc &#39;xp_getfiledetails&#39;<br/>exec sp_dro&#112;extendedproc &#39;Sp_OACr&#101;ate&#39; <br/>exec sp_dro&#112;extendedproc &#39;Sp_OADestroy&#39; <br/>exec sp_dro&#112;extendedproc &#39;Sp_OAGetErrorInfo&#39; <br/>exec sp_dro&#112;extendedproc &#39;Sp_OAGetProperty&#39; <br/>exec sp_dro&#112;extendedproc &#39;Sp_OAMethod&#39; <br/>exec sp_dro&#112;extendedproc &#39;Sp_OASetProperty&#39; <br/>exec sp_dro&#112;extendedproc &#39;Sp_OAStop&#39; <br/>exec sp_dro&#112;extendedproc &#39;Xp_regaddmultistring&#39; <br/>exec sp_dro&#112;extendedproc &#39;Xp_regdel&#101;tekey&#39; <br/>exec sp_dro&#112;extendedproc &#39;Xp_regdel&#101;tevalue&#39; <br/>exec sp_dro&#112;extendedproc &#39;Xp_regenumvalues&#39; <br/>exec sp_dro&#112;extendedproc &#39;Xp_regread&#39; <br/>exec sp_dro&#112;extendedproc &#39;Xp_regremovemultistring&#39; <br/>exec sp_dro&#112;extendedproc &#39;Xp_regwrite&#39; <br/>dro&#112; procedure sp_makewebtask<br/>go</div></div><br/><br/>假如需要恢复，可以使用下面的脚本：<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code16374);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="https://blog.imwebs.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code16374>use master <br/>exec sp_addextendedproc xp_cmdshell,&#39;xp_cmdshell.dll&#39; <br/>exec sp_addextendedproc xp_dirtree,&#39;xpstar.dll&#39; <br/>exec sp_addextendedproc xp_enumgroups,&#39;xplog70.dll&#39; <br/>exec sp_addextendedproc xp_fixeddrives,&#39;xpstar.dll&#39; <br/>exec sp_addextendedproc xp_loginconfig,&#39;xplog70.dll&#39; <br/>exec sp_addextendedproc xp_enumerrorlogs,&#39;xpstar.dll&#39; <br/>exec sp_addextendedproc xp_getfiledetails,&#39;xpstar.dll&#39; <br/>exec sp_addextendedproc sp_OACr&#101;ate,&#39;odsole70.dll&#39; <br/>exec sp_addextendedproc sp_OADestroy,&#39;odsole70.dll&#39; <br/>exec sp_addextendedproc sp_OAGetErrorInfo,&#39;odsole70.dll&#39; <br/>exec sp_addextendedproc sp_OAGetProperty,&#39;odsole70.dll&#39; <br/>exec sp_addextendedproc sp_OAMethod,&#39;odsole70.dll&#39; <br/>exec sp_addextendedproc sp_OASetProperty,&#39;odsole70.dll&#39; <br/>exec sp_addextendedproc sp_OAStop,&#39;odsole70.dll&#39; <br/>exec sp_addextendedproc xp_regaddmultistring,&#39;xpstar.dll&#39; <br/>exec sp_addextendedproc xp_regdel&#101;tekey,&#39;xpstar.dll&#39; <br/>exec sp_addextendedproc xp_regdel&#101;tevalue,&#39;xpstar.dll&#39; <br/>exec sp_addextendedproc xp_regenumvalues,&#39;xpstar.dll&#39; <br/>exec sp_addextendedproc xp_regread,&#39;xpstar.dll&#39; <br/>exec sp_addextendedproc xp_regremovemultistring,&#39;xpstar.dll&#39; <br/>exec sp_addextendedproc xp_regwrite,&#39;xpstar.dll&#39; <br/>go</div></div><br/>]]></description>
		</item>
		
</channel>
</rss>
