Motion.Dll
˽Ϊ2.6.1.29089汾˵ɵwww.flku.comԴ


Motion.DBCommand//ݿ
	|
	|----Motion.DBCommand.MsSqlCommand //MS-SQL
		|
		|-------public string vDataBaseConnectionString //ݿ
		|-------public string vErrorResultString //ݲϢ(ֻ)
		|-------public System.Data.DataTable vDataTable()
		|-------public System.Data.DataSet vDataSet()
		|-------public object vExecuteScalar()
		|-------public System.Data.SqlClient.SqlDataReader vExecuteReader()
		|-------public int vExecuteNonQuery()
		|-------public System.Data.SqlClient.SqlCommand vCommand()
		|
		|-------˵Ϸ+2
		|-------1(string _vCommandText)
			|-------_vCommandText: ҪִеSQL
			|
		|-------2(object[,] _vParameters, string _vCommandText, bool _vStoredProcedure)
			|-------object[,] _vParameters: ParametersֵһX2еobject͵Ķάʾ[0, X]ΪParameter[1, X]ΪParameterֵ
			|-------string _vCommandText: ҪִеSQL洢
			|-------bool _vStoredProcedure: ǷΪ洢
	|
	|----Motion.DBCommand.MsAccessCommand //MS-AccessࡡMS-SQLһԡ

Motion.CodeCommand//ܽ
	|
	|----DESC_Code //DESCӽ
		|
		|-----public string Encode(string data, string KEY_64, string IV_64)//ܷ
			|-------string data: Ҫַܵ
			|-------string KEY_64: Կλȣ
			|-------string IV_64: Կλȣ
			|
		|-----public string Encode(string data)//ܷ
			|-------string data: Ҫַܵ
			|
		|-----public string Dncode(string data, string KEY_64, string IV_64)//ܷ
			|-------string data: Ҫַܵ
			|-------string KEY_64: Կλȣ
			|-------string IV_64: Կλȣ
			|
		|-----public string Dncode(string data)//ܷ
			|-------string data: Ҫַܵ
			|
			|
	|----MD5_Code //MD5
		|
		|-----public string md5(string str)//md5ܷ
			|-------string str: Ҫַܵ
			|
		|-----public object md5(string str, bool raw_output)
			|-------string str: Ҫַܵ
			|-------bool raw_output: Ƿ񷵻ԭʼmd5 hash 16  byte[] 
			|
		|-----public object md5(string str, bool raw_output, System.Text.Encoding charEncoder)
			|-------string str: Ҫַܵ
			|-------bool raw_output: Ƿ񷵻ԭʼmd5 hash 16  byte[] 
			|-------System.Text.Encoding charEncoder: ַָб Encoding 

Motion.StringCommand //ַ
	|
	|----StringCom //ַ
		|
		|-----public string ChineseSpell(string strText)//մַ,ÿֵĴдʽƴĸ
			|-------string strText: Ҫȡƴַ
			|
		|-----public string RemoveHtmlCode(string Input) //ȥַеHTML
			|-------string Input: ȥHTMLǵַ
			|
		|-----public string Left(string Input, int LeftLength, bool AddDot, bool ByteLength, bool RemoveHtml) //ȡַָ
			|-------string Input: Ҫȡַ
			|-------int LeftLength: Ҫȡĳ
			|-------bool AddDot: ˽ȡǷʡԺ"..."
			|-------bool ByteLength: ǷֽڱȽϣһֽڣ
			|-------bool RemoveHtml: ǷȥַеHTML
			|
		|-----public string Right(string Input, int RightLength, bool AddDot, bool ByteLength, bool RemoveHtml) //ȡַұָ
			|-------string Input: Ҫȡַ
			|-------int LeftLength: Ҫȡĳ
			|-------bool AddDot: ˽ȡǷʡԺ"..."
			|-------bool ByteLength: ǷֽڱȽϣһֽڣ
			|-------bool RemoveHtml: ǷȥַеHTML
			|
		|-----public string RequestWebContent(string webUrl, System.Text.Encoding enCode, bool outError, string ErrorString)//ȡԶҳ
			|-------string webUrl: Ҫȡҳݵַ
			|-------System.Text.Encoding enCode: ҳ
			|-------bool outError: ǷϢ
			|-------string ErrorString: ԶϢ
			|
		|-----public string[] SplitString(string strContent, string strSplit)


ʹ÷˵

һĿãҵMotion.DllȷӼɡ

ӣ

//1.SQLݿ

Motion.DBCommand.MsSqlCommand msc = new Motion.DBCommand.MsSqlCommand("server=.;uid=sa;pwd=;database=test");

int CountI = msc.vExecuteNonQuery("update [UserInfo] set UserName='123'");

if(CountI==-1)
	Response.Write(String.Formate("Ϣ{0}", msc.vErrorResultString));
else
	Response.Write(String.Formate("{0}Ϣ", CountI));

//-----------------------------------
object[] Pars = new object[2, 2];

Pars[0,0] = "@UserName";
Pars[1,0] = "@UserPassword";

Pars[0,1] = Request.Form["UserName"];
Pars[2,1] = Request.Form["UserPassword"];

string SqlStr = "select top 1 UserID from [UserInfo] where UserName=@UserName and UserPassword=@UserPassword";
object UserID = msc.vExecuteReader(Pars, SqlStr, false);
if(Object.Equals(UserID, null))
{
	Response.Write("ûҵ¼");
	//ǲִܳ󣬿
	Response.Write(msc.vErrorResultString);
}



//2.DESCܽ
Motion.CodeCommand.DESC_Code dc = new Motion.CodeCommand.DESC_Code();

string Str = "123";
string StrE = dc.Encode(Str);
string StrD = dc.Dncode(StrE);
Response.Write(String.Format("DESCǰ{0}, ܺ{1}, ܺ{2}", Str, StrE, StrD));


//3.MD5
Motion.CodeCommand.MD5_Code mc = new Motion.CodeCommand.MD5_Code();

string m_Str = "123";
string m_StrE = mc.md5(m_Str);
Response.Write(String.Format("MD5ǰ{0}, ܺ{1}", m_Str, m_StrE));

//4.ƴĸ
Motion.StringCommand.StringCom sc = new Motion.StringCommand.StringCom();
string s_Str = "л񹲺͹";
string s_StrE = sc.ChineseSpell(s_Str);
Response.Write(String.Format("{0}ƴĸΪ{1}", s_Str, s_StrE));

//5.ȥHTML
string h_Str = "<font color=red>ɫ</font>";
string h_StrE = sc.RemoveHtmlCode(h_Str); 


Response.Write(String.Format("HTMLЧ֣{0}ûУȣͣԣЧ֣ {1}", h_Str, h_StrE));


//6.ַ

string l_Str = "<font color=red>ɫ</font>";
string l_StrE = sc.Left(l_Str, 5); 


Response.Write(String.Format("ִ{0}֣ {1}", l_Str, l_StrE));


//6.ַұ

string r_Str = "<font color=red>ɫ</font>";
string r_StrE = sc.Right(r_Str, 5); 


Response.Write(String.Format("ִ{0}ұ֣ {1}", r_Str, r_StrE));

//7.ȡԶҳ

string web_Url = "http://www.baidu.com";
string web_Content = sc.RequestWebContent(web_Url); 


Response.Write(web_Content);





----------------------------------------------------------------------
ļ"԰"------ɫվ
--------------------------------------------------------------
ǲƼ

                    ------԰,ϲ(www.okhan.net)
                    ------Դ,ƷԴ(www.okhan.cn)
--------------------------------------------------------------