1。用Delphi生成一个空的工程 2。将窗口从工程中Remove掉 3。写代码:program Project1;uses Forms, Windows;{$R *.RES} var cmd:String; begin cmd:='java -cp .\classes;"E:\AdventNet\WebNMS\classes\nmsarc2_2_1.jar";"E:\AdventNet\WebNMS\classes\xml.jar" com.zte.e10.ems.multine.IMSSetupFileMaker'; Application.Initialize; Application.Run; WinExec(PChar(cmd),SW_HIDE); end.
能不能解释上面的源程序。dephi能用?vc呢?有谁知道?
不过是用Delphic 完成了一个批处理命令而已. 就是借用了Java.exe 进行编译,你用bat, VB,VC都可以完成,都是一行话就完成了的,不必在意什么程序完成. 可以看看下面Java.exe 的帮助 Usage: JAVA.EXE [-options] class [args...] (to execute a class) or JAVA.EXE -jar [-options] jarfile [args...] (to execute a jar file)where options include: -cp -classpath <directories and zip/jar files separated by ;> set search path for application classes and resources -D<name>=<value> set a system property -verbose[:class|gc|jni] enable verbose output -version print product version -? -help print this help message -X print help on non-standard options
千万别以为死机,别管他,去看电视吧,估计一个小时就够了。
把 a.java 变成 a.exe;
end;
2。将窗口从工程中Remove掉
3。写代码:program Project1;uses
Forms,
Windows;{$R *.RES}
var
cmd:String;
begin
cmd:='java -cp .\classes;"E:\AdventNet\WebNMS\classes\nmsarc2_2_1.jar";"E:\AdventNet\WebNMS\classes\xml.jar" com.zte.e10.ems.multine.IMSSetupFileMaker';
Application.Initialize;
Application.Run;
WinExec(PChar(cmd),SW_HIDE);
end.
就是借用了Java.exe 进行编译,你用bat, VB,VC都可以完成,都是一行话就完成了的,不必在意什么程序完成.
可以看看下面Java.exe 的帮助
Usage: JAVA.EXE [-options] class [args...]
(to execute a class)
or JAVA.EXE -jar [-options] jarfile [args...]
(to execute a jar file)where options include:
-cp -classpath <directories and zip/jar files separated by ;>
set search path for application classes and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-? -help print this help message
-X print help on non-standard options