当前位置:网站首页>Skillfully using command line parameters in Delphi to realize the trigger function of dragging files onto program icons
Skillfully using command line parameters in Delphi to realize the trigger function of dragging files onto program icons
2022-07-24 11:49:00 【Nantong dxz】
Effect demonstration :
take 1.txt The content and content of 2.txt The contents of are merged and saved to 3.txt in
Core code :
procedure TForm1.FormShow(Sender: TObject);
var
i: integer;
ms: TMemoryStream;
ms2: TMemoryStream;
begin
showmessage(' The number of command line parameters is :' + inttostr(paramcount));
for i := 1 to ParamCount do
begin
showmessage(' The first ' + inttostr(i) + ' Command line parameters are :' + paramstr(i));
end;
showmessage(' Application name is :' + paramstr(0));
//TMemoryStream File merge
ms := TMemoryStream.Create;
ms.LoadFromFile(paramstr(1));
ms.Position := ms.Size; // Move file pointer
ms2 := TMemoryStream.Create;
ms2.LoadFromFile(paramstr(2));
ms.CopyFrom(ms2, 0);
ms.SaveToFile(GetCurrentDir + '\3.txt');
ms.Free;
ms2.Free;
Form1.Close;
end;
边栏推荐
- String -- 344. Reverse string
- Hash - 1. Sum of two numbers - some people fall in love during the day, some people watch the sea at night, and some people can't do the first question
- L1-049 seat allocation of ladder race
- Optimization method of "great mathematics for use" -- optimal design of Cascade Reservoir Irrigation
- The art of management - driving software R & D efficiency through leadership
- Shell Scripting tips
- Dry goods sharing - taking over a new data team as a lead - Problem Inventory and insights findings
- 容错、熔断的使用与扩展
- A* and JPS
- Hash - 242. valid alphabetic ectopic words
猜你喜欢

Semaphore details
What is cloud native? Why is cloud native technology so popular?

【网络空间安全数学基础第3章】同余

Paging query of employee information of black maredge takeout

JMeter if controller

Shell script "< < EOF" my purpose and problems

【C和指针第14章】预处理器

20000 words detailed explanation, thoroughly understand es!

Jmeter-While控制器

[TA frost wolf umay - "hundred people plan] Figure 3.3 surface subdivision and geometric shader large-scale grass rendering
随机推荐
【网络空间安全数学基础第3章】同余
字符串——剑指 Offer 05. 替换空格
Differences between JS map and foreach
生信周刊第37期
What is the charm of CSDN members? What's the use of him?
Paging query of employee information of black maredge takeout
字符串——344.反转字符串
Shell script "< < EOF" my purpose and problems
【C和指针第11章】动态内存分配
[QNX hypervisor 2.2 user manual]9.2 CmdLine
How to use a third party without obtaining root permission topic: MIUI chapter
Introduction to Devops and common Devops tools
Notes on @enableconfigurationproperties
L1-043 阅览室
离散分布常用公式及应用场景
Script redis write project notes
Install MariaDB columnstore (version 10.3)
Semaphore详解
L2-011 play with binary tree
Microservice - eruka