C£«£«ÈçºÎµ÷ÓÃdelphiÖÆ×÷µÄdll
Ò»¡¢¸ÅÊö¼°Ê¾Àý´úÂë
DelphiÖаüÀ¨Ðí¶àÒѾ·â×°ºÃµÄÀ༰¿Ø¼þ£¬ÆäÖеķǿÉÊÓ»¯¿Ø¼þ¿âÒÔ¹¦ÄÜ·½Ê½»®·Ö¿É´¦ÀíÖî¶àÓ¦ÓÃÐèÇó¡£ÈôʹÓÃC£«£«ÊµÏÖϵͳʱ¶ÔijЩ¹¦Äܼòµ¥µ÷ÓÃdelphiÖÐÏֳɵĿâʱ¼´¿É¡£Òò´Ë½«delphiÖеĿâÒÔDLLÐÎʽ·â×°ºÃÖ®ºóÈçºÎ½«·½·¨µ¼³ö¿É¹©C£«£«µ÷ÓÃÊDZ¾ÎļǼµÄÖص㡣C£«£«µ÷Óõķ½Ê½ÓжàÖÖ£¬ÔÚÕâÀïÖ»ÌÖÂÛÒ»ÖÖ¾²Ì¬±àÒ뷽ʽ£¬Ò»ÊÇΪÁË´úÂëµÄ¹æ·¶¿É¶ÁÐÔ£¬¶þÊÇ·ÀÖ¹½Ó¿Ú±ä»¯´øÀ´µÄά»¤ÎÊÌâ¡£
Delphi¶ÔÍâ½Ó¿Úµ¥Ôª£º
library ftpUpload;
uses
SysUtils,
Classes,
dialogs,
FileUpLuo in
'FileUpLuo.pas';
var
mTask :
TFtpUpFileLuo;
taskParam :
SUpTask;
{$R *.res}
function SendFile_luo(szSrcFile: pchar; szDesFile:
pchar;
szFtpServer: pchar; strUsername: pchar;
strPassword: pchar): Integer;
export; stdcall;
begin
mTask :=
TFtpUpFileLuo.Create(true);
with
taskParam do
begin
szSrc :=
szSrcFile;
szDes :=
szDesFile;
szServer
:= szFtpServer;
szUsername := strUsername;
szPassword := strPassword;
end;
result :=
mTask.TransFile(taskParam);
mTask.Resume;
end;
function GetUpPercent(nCmd: Integer) : Integer;
export; stdcall;
begin
mTask.SetCommand(nCmd);
result :=
mTask.GetUpStatus;
end;
exports
SendFile_luo index 1,
GetUpPercent index 2;
begin
end.
¶þ¡¢±àÒë¼°Éú³ÉLIBÎļþ
1£©µ÷ÊÔ¡¢±àÒëÉú³ÉftpUpload.dllÎļþ£»
2£©Impdef.exe ftpUpload
Ïà¹ØÎĵµ£º
µ÷Óú¯Êýʱ£¬¼ÆËã»ú³£ÓÃÕ»À´´æ´¢´«µÝ¸øº¯ÊýµÄ²ÎÊý¡£
Õ»ÊÇÒ»ÖÖÏȽøºó³öµÄÊý¾Ý½á¹¹£¬Õ»ÓÐÒ»¸ö´æ´¢Çø¡¢Ò»¸öÕ»¶¥Ö¸Õë¡£Õ»¶¥Ö¸ÕëÖ¸Ïò¶ÑÕ»ÖеÚÒ»¸ö¿ÉÓõÄÊý¾ÝÏ±»³ÆΪջ¶¥£©¡£Óû§¿ÉÒÔÔÚÕ»¶¥ÉÏ·½ÏòÕ»ÖмÓÈëÊý¾Ý£¬Õâ¸ö²Ù×÷±»³ÆΪѹջ(Push)£¬Ñ¹Õ»ÒÔºó£¬Õ»¶¥×Ô¶¯±ä³ÉмÓÈëÊý¾ÝÏîµÄλÖã¬Õ»¶¥Ö¸ÕëÒ²ËæÖ®Ð޸ġ£Óû§Ò²¿ÉÒÔ´Ó¶ÑÕ»ÖÐ ......
CÓïÑÔÎļþ²Ù×÷½Ó´¥ºÜ¾ÃÁË£¬Ò»Ö±Ã»ÓÐ×ܽáÏà¹ØÄÚÈÝ£¬½ñÌìÓõ½Á˾ÍÈ¥ÕÒÁËÕÒÏà¹ØÄÚÈÝ¡£
ÔÚANSI CÖУ¬¶ÔÎļþµÄ²Ù×÷·ÖΪÁ½ÖÖ·½Ê½£¬¼´Á÷ʽÎļþ²Ù×÷ºÍI/OÎļþ²Ù×÷
typedef struct {
int level; /* fill/empty level of buffer */
unsigned flags; /* File status flags */
char fd; /* File descriptor */
unsigned char hold ......
µÚÒ»´Î×ÐϸµØ¿´ÕâÖÖ´úÂ룬¶¼ÊÇ´ÓÍøÉϸ´ÖÆ×öÁËÂÔ΢¸Ä¶¯ºóµÄ²úÎï¡£´úÂëÈçÏ£º
#include "reg52.h"
unsigned char Count;
sbit Xiang=P1^2 ; //·äÃùÆ÷Ïì
unsigned char code SONG[] ={
0x26,0x20,0x20,0x20,0x20,0x20,0x26,0x10,0x20,0x10,0x20,0x80,0x26,0x20,0x30,0x20,
0x30,0x20,0x39,0x10,0x30,0x10,0x30,0x80,0x2 ......
¡¡¡¡1£¬mallocÓëfreeÊÇC++/CÓïÑԵıê×¼¿âº¯Êý£¬new/deleteÊÇC++µÄÔËËã·û¡£ËüÃǶ¼¿ÉÓÃÓÚÉêÇ붯̬ÄÚ´æºÍÊÍ·ÅÄÚ´æ¡£
¡¡¡¡2£¬¶ÔÓÚ·ÇÄÚ²¿Êý¾ÝÀàÐ͵ĶÔÏó¶øÑÔ£¬¹âÓÃmaloc/freeÎÞ·¨Âú×㶯̬¶ÔÏóµÄÒªÇ󡣶ÔÏóÔÚ´´½¨µÄͬʱҪ×Ô¶¯Ö´Ðй¹Ô캯Êý£¬¶ÔÏóÔÚÏûÍö֮ǰҪ×Ô¶¯Ö´ÐÐÎö¹¹º¯Êý¡£ÓÉÓÚmalloc/freeÊǿ⺯Êý¶ø²»ÊÇÔËËã·û£¬²»ÔÚ±àÒëÆ ......
ʲôÊǻص÷º¯Êý£¿
¡¡¡¡¼ò¶øÑÔÖ®£¬»Øµ÷º¯Êý¾ÍÊÇÒ»¸öͨ¹ýº¯ÊýÖ¸Õëµ÷Óõĺ¯Êý¡£Èç¹ûÄã°Ñº¯ÊýµÄÖ¸Õ루µØÖ·£©×÷Ϊ²ÎÊý´«µÝ¸øÁíÒ»¸öº¯Êý£¬µ±Õâ¸öÖ¸Õë±»ÓÃΪµ÷ÓÃËüËùÖ¸ÏòµÄº¯Êýʱ£¬ÎÒÃǾÍ˵ÕâÊǻص÷º¯Êý¡£
¡¡¡¡ÎªÊ²Ã´ÒªÊ¹Óûص÷º¯Êý£¿
¡¡¡¡ÒòΪ¿ÉÒ԰ѵ÷ÓÃÕßÓë±»µ÷ÓÃÕß·Ö¿ª¡£µ÷ÓÃÕß²»¹ØÐÄËÊDZ»µ÷ÓÃÕߣ¬ËùÓÐËüÐèÖªµÀµÄ£¬Ö»ÊÇ´æÔÚ ......