C#反编译微软MSDN2003的帮助文档,并将反编译结果保存到一个SQLSERVER数据库中__教程 |
|
日期:2007-5-20 0:37:44 人气:169 [大 中 小] |
|
|
|
string strFileName = ( string ) strFileNames[ HXSFileCount ]; System.IO.FileInfo myInfo = new System.IO.FileInfo( strFileName ); HXFileSizeCount += myInfo.Length ; InvokeSetProgress( this.MainProgress , (int)(HXSFileSize >> 5) , (int)( HXFileSizeCount >> 5 ) ); string strModleName = System.IO.Path.GetFileNameWithoutExtension( strFileName ) + "\\" ; InvokeSetLabelText( lblFile , "正在处理第 " + HXSFileCount + " 个文件 " + System.IO.Path.GetFileName( strFileName ) + " " + myInfo.Length + " 字节 ..." ); InvokeSetLabelText( lblState ,"正在反编译..." ); string strOutSubDir = System.IO.Path.Combine( strOutDir ,"temp"); if( System.IO.Directory.Exists( strOutSubDir) == false) System.IO.Directory.CreateDirectory( strOutSubDir ); int BasePathLength = ( strOutSubDir.EndsWith("\\") ? strOutSubDir.Length : strOutSubDir.Length + 1 ) ; // 执行命令行程序来反编译HXS文档 string strCmd = " -d " + strOutSubDir + " -u \"" + strFileName + "\" -i -e -w -q"; System.Diagnostics.ProcessStartInfo myPInfo = new System.Diagnostics.ProcessStartInfo( strExeFile , strCmd ); myPInfo.CreateNoWindow = true; myPInfo.UseShellExecute = false; System.Diagnostics.Process myProcess = System.Diagnostics.Process.Start( myPInfo ); myProcess.WaitForExit(); if( bolCancel ) break; // 找到所有反编译所得的文件 System.Collections.ArrayList myNames = GetFileNames( strOutSubDir ); InvokeSetLabelText(lblState , "正在导入到数据库,共 " + myNames.Count + " 个文件 ..." ); for( int iCount = 0 ; iCount < myNames.Count ; iCount ++ ) |
|
出处:本站原创 作者:佚名 |
|
|