【问题标题】:(Delphi) How to use DosCommand Component? [closed](Delphi) 如何使用 DosCommand 组件? [关闭]
【发布时间】:2017-01-14 16:20:25
【问题描述】:

我已经在 Rad Studio Berlin 10 更新 2 上安装了 https://github.com/TurboPack/DOSCommand,但我不知道如何使用它。我已经尝试过使用它,并且我已经通过谷歌搜索寻找示例,但我找不到任何示例。

【问题讨论】:

    标签: delphi delphi-10.1-berlin


    【解决方案1】:

    很遗憾,您的问题没有详细说明。 如果您成功安装了组件,它应该会出现在组件面板中。请将它放在您的表单上,在对象检查器中调整属性并调用Execute

    顺便说一句,您是否阅读了单元标题中的“如何使用它”和“示例”cmets?

     *******************************************************************
      How to use it :
      ---------------
      - just put the line of command in the property 'CommandLine'
      - execute the process with the method 'Execute'
    

    例子

      Example : Make a dir :
      ----------------------
      - if you want to get the Result of a 'c:\dir /o:gen /l c:\windows\*.txt'
      for example, you need to make a batch file
      --the batch file : c:\mydir.bat
      @echo off
      dir /o:gen /l %1
      rem eof
      --in your code
      DosCommand.CommandLine := 'c:\mydir.bat c:\windows\*.txt';
      DosCommand.Execute;
    

    【讨论】:

    • 谢谢。抱歉回复晚了,但由于某种原因,我在单元标题中没有“如何使用它”和“示例”cmets。
    • 我真的很想念组件的方法和属性的文档,但我可以对它们的含义和用法做出假设。你能指点我一些关于组件的文档吗?我必须默默地执行一个计算引擎,它返回一个字符串列表,其中包含有关天体(行星等)的天文数据。我需要知道如何默默地做到这一点,将带有数据的命令字符串传递给程序,最后将结果放入 TMemo 或其他东西中。
    猜你喜欢
    • 1970-01-01
    • 2014-11-06
    • 1970-01-01
    • 2013-12-07
    • 2011-07-08
    • 2023-03-23
    • 1970-01-01
    • 2011-06-10
    • 2023-03-13
    相关资源
    最近更新 更多