This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class E | |
{ | |
const string DEFAULT_ALPHABET = "mn6j2c4rv8bpygw95z7hsdaetxuk3fq"; | |
const int DEFAULT_BLOCK_SIZE = 24; | |
const int MIN_LENGTH = 5; | |
public E() | |
{ | |
this.Alphabet = DEFAULT_ALPHABET; | |
this.BlockSize = DEFAULT_BLOCK_SIZE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DownloadFile | |
{ | |
public static void Download(Session oSession, string allowDomain) | |
{ | |
if (oSession.responseCode != 200) | |
{ | |
return; | |
} | |
string[] validDomain = allowDomain.Split(new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class WCFFactory<T> : System.ServiceModel.ClientBase<T> | |
where T : class | |
{ | |
public WCFFactory(string endpointConfigurationName) | |
: base(endpointConfigurationName) | |
{ | |
} | |
public T GetService() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
doskey python27=D:\Python27\python.exe $* | |
doskey python31=D:\Python31\python.exe $* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UrlConvert | |
{ | |
#region Url Shortener | |
// http://blog.madskristensen.dk/post/Resolve-and-shorten-URLs-in-Csharp.aspx | |
private static readonly Regex regex = new Regex("((http://|www\\.)([A-Z0-9.-:]{1,})\\.[0-9A-Z?;~&#=\\-_\\./]{2,})", RegexOptions.Compiled | RegexOptions.IgnoreCase); | |
private static readonly string link = "<a href=\"{0}{1}\">{2}</a>"; | |
/// <summary> | |
/// 缩短链接中Url地址 | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 类名: StringConvertUtil | |
/// 描述: 实现字符串的转换 | |
/// 作者: Heclei | |
/// 版本: 1.0.0.0 | |
/// 日期: 2007-04-11 | |
/// </summary> | |
public class StringConvert | |
{ | |
#region 转16进制字符串 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StringUtil | |
{ | |
#region 截取中文字符串 | |
/// <summary> | |
/// 获取 gb2312 字符串长度 | |
/// </summary> | |
/// <param name="content">字符串,兼容Null和DbNull.Value</param> | |
/// <param name="length">长度</param> | |
/// <returns></returns> | |
public static string GetGB2312StringLength(object obj, int length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string CleanInvalidXmlChars(string text) | |
{ | |
// From xml spec valid chars: | |
// #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] | |
// any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. | |
string re = @"[^\x09\x0A\x0D\x20-\xD7FF\xE000-\xFFFD\x10000-x10FFFF]"; | |
return Regex.Replace(text, re, ""); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SSBXmlTextWriter : XmlTextWriter | |
{ | |
private static Regex InvalidXMLCharacter = new Regex(@"[\u0000-\u0008\u000B\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]", RegexOptions.Compiled); | |
public SSBXmlTextWriter(TextWriter w) | |
: base(w) | |
{ | |
} | |
public SSBXmlTextWriter(Stream w, Encoding encoding) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET VSNET_BINPATH="C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\xsd.exe" | |
%VSNET_BINPATH% /c /namespace:Framework.DataAccess DataAccessSettings.xsd | |
%VSNET_BINPATH% /c /namespace:Framework.DataAccess DataOperations.xsd |