简体   繁体   English

访问java中c#脚本中的信息

[英]accessing information within c# script in java

I created a new exe with a C# script which I then execute inside of a Java program. 我用C#脚本创建了一个新的exe,然后我在Java程序中执行它。 The exe will pull a string from a process that is running and print it to the screen. exe将从正在运行的进程中拉出一个字符串并将其打印到屏幕上。 I was wondering how to access that string in the exe through Java, if there is a way. 我想知道如何通过Java访问exe中的字符串,如果有办法的话。

Process proc = Runtime.getRuntime().exec(...);
InputStream in = proc.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String txt = null;
while ((txt = br.readLine()) != null) {
  //...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM