|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
ASP在国内异常流行,因为国内大多使用的是盗版的Windows和盗版的SQLServer,而ASP+COM+SQLServer实际上也是一种不错的搭配,其性能也不输于PHP+MYSQL,特别是Windows系统和SQLServer都有图形界面,比APACHE和MYSQL易于维护,因此对于不重视知识产权的国家来说也是一种不错的选择。统计作者的blog:blog.never-online.net
"NeverModules"-NCC(nevercodecounter)tools-代码统计工具V1.01
统计js,asp,aspx,cs,html,xml等
把源代码存为(hta)文件,由于hta文件没有形态栏,以是我这里倡议人人存为html文件,如许能够在形态栏下看到NCC扫描的进度,我这里把NCC的maxloop设置为3000,以是文件统计到3000的时分,会主动停止,以防文件夹中文件太多形成运转的包袱。
次要功效有:
1、可本人选择文件夹,大概单个文件。
2、本人选择文件后缀名举行统计
3、outputinformation输入的数占有:
文件个数,
文件的代码字节数,
单词个数,
代码行数,
总代码字节数
总代码行数。
4、能够将数据用SaveAs存为html大概txt文件
运转代码框
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01//EN""http://www.w3.org/TR/html4/strict.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><title>NCCTools-http://www.never-online.net</title><hta:applicationid="NCC"applicationname="NCCapplication"border="thin"borderstyle="normal"caption="yes"icon="http://www.never-online.net/images/icon.ico"maximizebutton="no"minimizebutton="yes"showintaskbar="no"singleinstance="yes"sysmenu="yes"version="1.01"windowState="normal"/><metahttp-equiv="ImageToolbar"content="no"/><metaname="author"content="BlueDestiny,never-online"/><metaname="keywords"content="nevermodules,Mozilla CSS,C#,.net,Refercence,BlueDestiny,never-online,www.never-online.net"/><metaname="description"content="BlueDestiny,never-online"/><metaname="title"content="nevercodecounter(NCC)-http://www.never-online.net"/><metaname="creator.name"content="GeniusLau,never-online,blueDestiny"/><styletype="text/css"media="all"title="Default">body{background-color:buttonface;}body,td,input{font:9pttahoma;}h1{text-align:center;font-weight:bold;font-family:tahoma;font-size:16pt;}fieldset{height:300px;}legend{font-weight:bolder;}.btn{border-left:4pxsolid#444;border-top:1pxsolid#444;border-bottom:1pxsolid#444;border-right:1pxsolid#444;}.two{width:200px;}.txt{border:1pxsolid#444;}.file{display:none;width:300px;border-left:4pxsolid#444;border-top:1pxsolid#444;border-bottom:1pxsolid#444;border-right:1pxsolid#444;}#loading{display:none;filter:alpha(opacity=70);border:1pxsolid#444444;background-color:appworkspace;color:#ffffff;width:300px;font-size:13px;font-weight:bold;font-family:arial;padding:10px;position:absolute;top:0;left:0;}#left{line-height:200%;width:50%;padding:20px;}#leftul{margin:00010px;}#leftli{list-style-type:decimal;margin:20px10px15px10px;}#footer{font-size:11px;text-align:center;}#right{padding:20px;width:50%;}#outputWrapper{padding:10px;}</style><scripttype="text/javascript">//<![CDATA[//======================================================================================////Module:NCC-nevercodecounterV1.01beta//Scriptby:never-online,blueDestiny//Updated:2006-6-25//Copyright:Miracletechnologyallreserved//Website:http://www.never-online.net//Email:blueDestiny@126.com//Blog:http://blog.csdn.net/blueDestiny,http://blog.never-online.net///Comment:PermissiongiventousethisscriptinANYkindofapplicationsif//headerlinesareleftunchanged.////======================================================================================//====================================================================================//UltityFunctionvardoc=document,wnd=window;String.prototype.trim=function(){returnthis.replace(/(^s*)|(s*$)/g,);};Array.prototype.push=function(x){this[this.length]=x;};Array.prototype.pop=function(){returnthis[this.length-1];};//====================================================================================varNCC={//PrivateVariables_maxloop:3000,_version:"1.02beta",_author:"BlueDestiny,never-online",_webURI:"http://www.never-online.net",_lines:{"total":0},_bytes:{"total":0},_files:{"total":0},_words:{"total":0},_error:{},_filesExts:"cs,js,asp,xml,aspx",_fsoObj:newActiveXObject("Scripting.FileSystemObject")//makesureYourfsoactiveXObjectisavaild.otherwisecannotruningnextcode};//PublicFunctionsAPINCC.splash=function(){};NCC.init=function(){varfileDlgObjStr=<objectid="filepathDlg"+width="0px"height="0px"+classid="CLSID:F9043C85-F6F2-101A-A3C9-08002B2F49FB"+codebase="http://activex.microsoft.com/controls/vb5/comdlg32.cab">+</object>;varfolderDlgObjStr=<objectid="folderpathDlg"+classid="CLSID:13709620-C279-11CE-A49E-444553540000"+width="0"height="0">+</object>;varloadingObjStr=<divid="loading"></div>;doc.body.insertAdjacentHTML("beforeEnd",fileDlgObjStr);doc.body.insertAdjacentHTML("beforeEnd",folderDlgObjStr);doc.body.insertAdjacentHTML("beforeEnd",loadingObjStr);}NCC.chkFileExts=function(filenameStr){vara=this._filesExts.trim().split(",");varf=this.getFileExts(filenameStr);for(vari=0;i<a.length;i++)if(f.toLowerCase()==a .toLowerCase())returntrue;returnfalse;};NCC.output=function(wrapperID){vark,x;x=[];x.push("-------------Files-------------");//--partoffiles--for(kinthis._files)x.push("["+k+"]:"+this._files[k]+"");//--partofwords--x.push("-------------Words-------------");for(kinthis._words)x.push("["+k+"]:"+this._words[k]+"");//--partofbytes--x.push("-------------Bytes-------------");for(kinthis._bytes)x.push("["+k+"]:"+this._bytes[k]+"");//--partoflines--x.push("-------------Lines-------------");for(kinthis._lines)x.push("["+k+"]:"+this._lines[k]+"");x=x.join("
");if(wrapperID){vara=doc.all(wrapperID),t=a.tagName.toLowerCase();if(!a)returnwnd.alert("HTMLElementID""+wrapperID+""isnotvalid!");if(t=="input"||t=="textarea")a.value=x;elsea.innerHTML=x.replace(/
/,"<br/>");}returnx;};NCC.saveAs=function(elIdorStr){vardlg=doc.all("filepathDlg");vara=doc.all(elIdorStr);if(a){vart=a.tagName.toLowerCase();varfileStr=(t=="input"||t=="textarea")?a.value:a.innerHTML.replace(/<br(/)?>/g,"
");}else{fileStr=elIdorStr;}dlg.cancelError=true;try{dlg.filter="TextFiles(*.txt)|*.txt|HTMFiles(*.htm)|*.htm";dlg.showSave();varf=this._fsoObj.CreateTextFile(dlg.filename,true);f.write(fileStr);f.Close();}catch(ex){};};NCC.setFilesExt=function(filesExtsStr){this._filesExts=filesExtsStr;returntrue;};NCC.getFilesExts=function(){returnthis._filesExts;};NCC.getFileExts=function(filenameStr){vara=filenameStr.split(".");returna[a.length-1].toLowerCase();//a.pop()};NCC.selectSingleFile=function(){vardlg=doc.all("filepathDlg");varfps=doc.all("filepathStr");varfes=this._filesExts;varfilename="",filter="",arr=[];arr=fes.trim().split(",");for(vari=0;i<arr.length;i++)filter+=arr.toUpperCase()+"Files(*."+arr+")|*."+arr+""+(i==arr.length-1?"":"|");dlg.cancelError=true;try{dlg.filter=filter;dlg.showOpen();filename=dlg.filename;}catch(ex){};if(filename.trim()=="")returnfalse;fps.value=filename;if(!this.chkFileExts(filename))returnwnd.alert("FileExtensionname""+filename+""isnotvalid!");returnfilename;};NCC.selectFolder=function(){vardlg=doc.all("folderpathDlg");try{varpathObj=dlg.browseForFolder(0,"PleaseSelectFolder:",0);varpathStr=pathObj.parentFolder.parseName(pathObj.Title).path;returnpathStr;}catch(ex){returnfalse};};NCC.countFolder=function(folderpathStr){varldg=doc.all("loading");with(ldg.style){display="block";top=parseInt((doc.body.clientHeight-ldg.offsetHeight)/2);left=parseInt((doc.body.clientWidth-ldg.offsetWidth)/2);};ldg.innerHTML="<divalign="center">NowCounting...</div>";wnd.status="NCCCounting...";if(!this._fsoObj.FolderExists(folderpathStr)){this.countSingleFile(folderpathStr);}else{varcnt=0;functioniterator(folderpathStr){vara=NCC._fsoObj.getFolder(folderpathStr);vare=newEnumerator(a.files)for(;!e.atEnd();e.moveNext()){NCC.countSingleFile(e.item());if(cnt++>=NCC._maxloop)return;}varf=newEnumerator(a.subFolders)for(;!f.atEnd();f.moveNext()){iterator(f.item());if(cnt++>=NCC._maxloop)return;}}iterator(folderpathStr);}ldg.innerHTML="<divalign="center">NCCCountCompletely.</div>"wnd.status="NCCCountCompletely.";wnd.setTimeout(function(){ldg.style.display="none";},3000);};NCC.countSingleFile=function(filepathStr){varx,a,f,e;varldg=doc.all("loading");if(!this._fsoObj.FileExists(filepathStr))returnfalse;f=this._fsoObj.GetFile(filepathStr);if(this.chkFileExts(f.name)){varo=f.openAsTextStream(1);if(o.atEndOfStream){x="";}else{x=o.ReadAll();}x=x.replace(/(
|)+/mg,"$1");a=x.split("
");e=this.getFileExts(f.name);this._bytes["total"]+=x.length;this._bytes[e]?this._bytes[e]+=x.length:this._bytes[e]=x.length;this._lines["total"]+=a.length;this._lines[e]?this._lines[e]+=a.length:this._lines[e]=a.length;a=x.replace(/(s| |)+/g,"").split("");this._words["total"]+=a.length;this._words[e]?this._words[e]+=a.length:this._words[e]=a.length;this._files["total"]++;this._files[e]?this._files[e]++:this._files[e]=1;}wnd.status="NCC(""+f.path+"")";ldg.innerHTML="nowcount""+f.name+""."returnthis.chkFileExts(f.name)};NCC.formatSingleFile=function(filepathStr){};//====================================================================================functionwindow.onload(){NCC.init();wnd.resizeTo(800,480);doc.all("outputWrapper").value="";setFilesExts();//setFilesExts.call(this);}functionsetFilesExts(){doc.all("filesExts").value=NCC.getFilesExts();}functionoutput(){/*vare=event.srcElement;vara=doc.body.all;for(vari=0;i<a.length;i++){if(a.tagName.toLowerCase()=="input"){if(a!=e)a.disabled=true;}}*/NCC.setFilesExt(doc.all("filesExts").value)NCC.countFolder(doc.all(filepathStr).value);NCC.output(outputWrapper);}functionchangeFileExt(){vargroupfileExts=doc.all("groupfileExt");varfileExtStr=[];for(vari=0;i<groupfileExts.length;i++){if(groupfileExts.checked)fileExtStr.push(groupfileExts.value);}NCC.setFilesExt(fileExtStr.join(","));setFilesExts();}functionselectSingleFile(val){if(!NCC.selectSingleFile())return"";doc.all(val).value=NCC.selectSingleFile();}functionselectFolder(val){vara=NCC.selectFolder();if(a==false)return"";doc.all(val).value=a;}functionsaveAs(){NCC.saveAs(outputWrapper);//NCC.saveAs(NCC.output());}//]]></script></head><bodyid="www.never-online.net"><h1>NCC(nevercodecounter)tools-http://www.never-online.net</h1><fieldset><legend>-ApplicationNCC(nevercodecounter)-</legend><tablewidth="100%"border="0"cellpadding="0"cellspacing="0"><tr><tdalign="left"valign="top"id="left"><ul><li><inputname="filepathStr"type="text"class="txt"value="E:\__works\__website"size="30"><inputclass="btn"type="button"value="FILE"/><inputclass="btn"type="button"value="FOLDER"/></li><li><inputname="groupfileExt"value="asp"type="checkbox"checked/>.asp<inputname="groupfileExt"value="js"type="checkbox"checked/>.js<inputname="groupfileExt"value="xml"type="checkbox"checked/>.xml<inputname="groupfileExt"value="aspx"type="checkbox"checked/>.aspx<inputname="groupfileExt"value="cs"type="checkbox"checked/>.cs<br/><inputname="filesExts"type="text"class="txt"id="filesExts"value=""size="40"></li><li><inputclass="btntwo"type="button"value="OutputInformation"/><!--notcomplete<inputname="button"type="button"class="btn"value="FormatCode"/>--></li><li><inputclass="btntwo"type="button"value="InformationSaveAs"/></li></ul><divid="footer"><p>NCCV1.01betaPowerByBlueDestiny,never-online<br/>Morecodepleasevisit<ahref="http://www.never-online.net"target="_blank"title="visitmysite">http://www.never-online.net</a></p></div></td><tdalign="left"valign="top"id="right"><fieldset><legend>-OutputInformation-</legend><textareaid="outputWrapper"style="border:0;background-color:buttonface;width:96%;height:100%;"></textarea></fieldset></td></tr></table></fieldset></body></html>
[Ctrl+A全体选择提醒:你可先修正部分代码,再按运转]
当然了,现在国内CRM厂商的产品与其说是CRM,但从至少从我的角度分析上来看,充其量只是一个大型的进销存而已了,了解尚浅,不够胆详评,这里只提技术问题 |
|