Get Processes()上没有回报 [英] No Return On Get Processes()

查看:129
本文介绍了Get Processes()上没有回报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行我从Microsoft网站获得的这段代码.但是;即使我有多个记事本实例正在运行,我也无法返回到控制台屏幕.任何帮助表示赞赏.谢谢.

I''m running this code I got of the Microsoft site. however;I not getting any return to the console screen even though I have several instances of notepad running. Any help is appreciated. Thanks.

public:
static array<process^>^ GetProcesses(
	String^ machineName
)
#include "stdafx.h"
#include <iostream>

#using <system.dll>

using namespace System;
using namespace System::Diagnostics;
using namespace System::ComponentModel;
int main()
{
   Process^ currentProcess = Process::GetCurrentProcess();
   array<process^>^localByName = Process::GetProcessesByName( "notepad" );
}

推荐答案

据我所知,您希望发布的代码将某些内容写入控制台.
事实并非如此,这是可以预期的,因为您没有编写任何东西.如果要向控制台写入内容,则应使用控制台类 [ ^ ]例如Console.WriteLine("Writing to console");
Ok from what I can understand; You expect the posted code to write something to the console.
It does not and that is to be expected as you''re not writing anything. If you want to write something to the console then you should use the Console class[^] e.g. Console.WriteLine("Writing to console");


这篇关于Get Processes()上没有回报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆