摘要:
Asp.Net中使用正则表达式进行数据验证using System.Text.RegularExpressions;private bool checkMobile(string mobile){string regex0 = @"\d{11}"; string regex = @"(13[0-9]?|15[89])[0-9]{8}"; if (!Regex.IsMatch(mobile, regex0) || !Regex.IsMatch(mobile, regex)) { return false; }return true;}详细内容可参考 &qu 阅读全文
摘要:
wsdl.exe /l:cs /n:myNamespace /out:myFilename.cs http://www.abc.com/hello/hello.asmx?wsdl将生成的文件如myFilename.cs,通过CSC或者VBC编译工具,生成相应的Proxy Dll文件即可如:csc /target:library /out:"c:\proxy.dll" c:\proxy.cs wsdl /l:cs /n:BbsInterface /out:ForPngWebService.cs http://10.0.0.1/ForPngWebService.asmx?wsd 阅读全文
摘要:
字符串和Byte数组互换的两个方法适用环境:.net1. 使用Encoding类,字符集可以换成ASCII,UTF7等txtOutput.Text = System.Text.Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(txtInput.Text));2. 使用Convert类// 当Convert.FromBase64String方法的参数的长度小于4或不是4的倍数时,将会抛出FormatException。txtOutput.Text = System.Convert.ToBase64String(Convert.FromBase64Str 阅读全文
摘要:
http://www.codeproject.com/KB/aspnet/DisableSubmitButton.aspxDisable ASP Button on Submit and capture the PostBack OnClick EventBy Christopher G. LasaterThis article describes how to disable a ASP button on click to prevent multiple clicks and still fire the button event on the server.override prote 阅读全文
摘要:
Sql Server数据库迁移孤立用户的问题处理适用数据库: SQL Server 7.0、SQL Server 2000 和 SQL Server 2005表面现象: 对象名 ‘xxxx’ 无效 Login failed for user '%ls'. Server user '%.*ls' is not a valid user in database '%.*ls'. 服务器用户“%s”不是数据库“%s”中的有效用户。请先将该用户帐户添加到数据库中进一步的现象: 创建和以前用户相同帐号(如test),相同密码的帐号,还是不能访问属于以前用户 阅读全文