简单地说,一个具有以下三个类的控制台应用程序,
namespace Stackoverflow
{
public class Program
{
public static void Main ( string [ ] args )
{
new Consumer ( );
new Provider ( );
Console . WriteLine ( "Exit ..." );
Console . ReadKey ( );
}
}
public class Consumer
{
public Consumer ( )
{
using ( Process Process = Process . GetCurrentProcess ( ) )
{
Console . WriteLine ( "Consumer : " + Process . ProcessName );
}
}
}
public class Provider
{
public Provider ( )
{
using ( Process Process = Process . GetCurrentProcess ( ) )
{
Console . WriteLine ( "Provider : " + Process . ProcessName );
}
}
}
}
输出将如下,
Consumer : Stackoverflow.vshost
Provider : Stackoverflow.vshost
Exit ...
问题:
我可以将每个类附加到不同的流程,而不将它们分成不同的解决方案,尤其是提供者和消费者类吗?
这是为了测试目的。移动代理相关测试。
提前致谢。
问候,