小女巫 发表于 2015-1-16 22:50:54

ASP.NET网站制作之一个C++及Delphi做的紧缩程序

我感觉可以顶到50楼,出乎意料的是大家居然纷纷写出自己的博文,还被编辑做成了专题,置于首页头条。{ThisisinterfaceofC++code.
C++sourcecodenotincludedtothisarchive.
LookREADME.TXTfileformoreinformation.}

#ifndef__CODING_H__
#define__CODING_H__

#ifndefcoding_impex
#definecoding_impex__declspec(dllimport)
#endif

classcoding_impexavlDecode
{
public:
~avlDecode();
avlDecode();

virtualintReadBuf
(void*buf,
unsignedmaxLen,
unsigned&rdlen
)=0;

intGet(void*buf,unsignedmaxLen);
intGet(void*buf,unsignedmaxLen,unsigned&rdLen)
{return((int)(rdLen=Get(buf,maxLen))<0)?rdLen:0;
}

voidReset();

private:

?????????privatepartnotincluded???????????????????

};


classcoding_impexavlEncode
{
public:
~avlEncode();
avlEncode();

virtualintWriteBuf
(void*buf,
unsignedlen
)=0;


intPut(void*buf,unsignedn);
voidReset();

private:
??????????Privatepartnoticluded?????????????

};

#endif//__CODING_H__


///encode.pas
{$M8192,120000,120000}
usesavlcodes;

constBUFSIZE=60000;

varp:pointer;
f,f1:file;
s:string;
buf:pointer;
num:word;

{$F+}

FunctionWriteToFile(varbuf;n:integer):integer;
varnum:word;
Begin
BlockWrite(f1,buf,n,num);
End;

{$F-}

Begin
ifnotGetMemorythen
Begin
WriteLn(NotenoughmemoryinHEAPtocompressfile.);
halt;
End;
s:=paramstr(1);
SetEncodeOutBuffer(@WriteToFile);
assign(f,s);
{$I-}
ifsthenReset(f,1);
{$I+}
if(IoResult0)or(s=)then
Begin
WriteLn;
WriteLn(TheauthorofthisTurboPascalprogramandoriginalC++codeis);
WriteLn(AlexanderLarkin(translatedtoTurboPascalfromC++on27/09/1999));
WriteLn;
WriteLn(E-mail:avlarkin@writeme.com);
WriteLn(Internet:http://www.geocities.com/SiliconValley/6235/tpdl.htm);
WriteLn;
WriteLn(Usage:encode.exeInFileOutFile);
WriteLn;
FreeMemory;
halt;
End;
s:=paramstr(2);
Assign(f1,s);
{$I-}
ifsthenReWrite(f1,1);
{$I+}
if(IoResult0)or(s=)then
Begin
Close(f);
WriteLn(Cannotcreatefindfile+s);
FreeMemory;
halt;
End;
SetPassword(ParamStr(3));
GetMem(buf,BUFSIZE);
repeat
BlockRead(f,buf^,BUFSIZE,num);
EncodePut(buf^,num);
untilnum<=0;
ifnum<0thenWriteLn(Cannotcompressfile.Youdosomethingwrong.);
EncodeReset;
Close(f);
Close(f1);
FreeMemory;
End.

///decode.pas
{$M8192,120000,120000}
usesavlcodes;

constBUFSIZE=60000;

varp:pointer;
f,f1:file;
s:string;
buf:pointer;
num:word;

{$F+}

FunctionReadFromFile(varbuf;n:integer;varrdlen:integer):integer;
Begin
BlockRead(f,buf,n,rdlen);
ReadFromFile:=0;
End;

{$F-}

Begin
ifnotGetMemorythen
Begin
WriteLn(NotenoughmemoryinHEAPtodecompressfile.);
halt;
End;
s:=paramstr(1);
SetDecodeInBuffer(@ReadFromFile);
assign(f,s);
{$I-}
ifsthenReset(f,1);
{$I+}
if(IoResult0)or(s=)then
Begin
WriteLn;
WriteLn(TheauthorofthisTurboPascalprogramandoriginalC++codeis);
WriteLn(AlexanderLarkin(translatedtoTurboPascalfromC++on27/09/1999));
WriteLn;
WriteLn(E-mail:avlarkin@writeme.com);
WriteLn(Internet:http://www.geocities.com/SiliconValley/6235/tpdl.htm);
WriteLn;
WriteLn(Usage:decode.exeInFileOutFile);
WriteLn;
FreeMemory;
halt;
End;
s:=paramstr(2);
Assign(f1,s);
{$I-}
ifsthenReWrite(f1,1);
{$I+}
if(IoResult0)or(s=)then
Begin
Close(f);
WriteLn(Cannotcreatefile+s);
FreeMemory;
halt;
End;
GetMem(buf,BUFSIZE);
SetPassword(ParamStr(3));
repeat
num:=DecodeGet(buf^,BUFSIZE);
ifnum<65535thenBlockWrite(f1,buf^,num,num);
until(num=0)or(num=65535);
ifnum=65535thenWriteLn(Error!Datacorrupted.Cannotdecompressfile.);
Close(f);
Close(f1);
FreeMemory;
End.
http://www.ckuyun.com/

c语言的编译器,几乎是所有新平台都有的。因此从这点上看,c语言的程序,比其他任何语言更加容易跨平台。

小妖女 发表于 2015-1-20 05:32:21

当然我们在选择Asp.net主机是,除了要考虑服务提供商在版本是否是实时更新以外,机房的环境和配置也是非常重要的,通常选择骨干网的机房,在速度和稳定性上会非常有保证。

爱飞 发表于 2015-1-25 18:19:48

ASP.net1.1和2.0在程序上的语法也有很大不同,现在2.0属于新出来的,不知道半年后会不会有3.0(说笑一下)。Windows2003系统自动支持ASP和ASP.net环境,不用安装任何程序。Asp.net属于编译语言。ASP的最大不同(ASP属于解释语言)。

愤怒的大鸟 发表于 2015-2-3 12:46:56

有一丝可惜的是,这个系列太强了,Java阵营的朋友根本就是哑口无言...争论之火瞬间被浇灭,这不是我想这么早就看到的,但是值了。

若相依 发表于 2015-2-9 01:22:14

通过这次激烈的讨论,我从大家身上学到了太多,开阔了眼界,不管是支持我的还是骂我的,都感谢你们。

老尸 发表于 2015-2-26 17:02:42

以上是语言本身的弱点,在功能方面ASP同样存在问题,第一是功能太弱,一些底层操作只能通过组件来完成,在这点上是远远比不上PHP/JSP,其次就是缺乏完善的纠错/调试功能,这点上ASP/PHP/JSP差不多。

海妖 发表于 2015-3-8 16:13:30

我觉得什么语言,精通就好,你要做的就是比其他80%的人都厉害,你就能得到只有20%的人才能得到的高薪。

金色的骷髅 发表于 2015-3-22 20:10:45

ASP.NET:ASP.net是Microsoft.net的一部分,作为战略产品,不仅仅是ActiveServerPage(ASP)的下一个版本;它还提供了一个统一的Web开发模型,其中包括开发人员生成企业级Web应用程序所需的各种服务。ASP.NET的语法在很大程度上与ASP兼容,同时它还提供一种新的编程模型和结构,可生成伸缩性和稳定性更好的应用程序,并提供更好的安全保护。
页: [1]
查看完整版本: ASP.NET网站制作之一个C++及Delphi做的紧缩程序