我如何编写一个简单的 - 最简单的工作 - 测试应用程序,说明如何使用IPC /命名管道?
例如,如何编写一个控制台应用程序,程序1将"Hello World"写入程序2,程序2接收消息并将"Roger That"回复给程序1.
如何在c#中设置TextBox的字体大小.我可以获得当前大小,但不允许设置它.
public static Form client;
((TextBox)client.Controls[0]).Font.size = 16;
Run Code Online (Sandbox Code Playgroud) 使用示例1:在此MSDN教程中创建,启动和交互线程,更具体地说是第3行到第7行Main()
我有以下代码,出现以下错误:
无法使用实例引用访问; 用类型名称来限定它.
Program.cs中
public static ThreadTest threadTest = new ThreadTest();
private static Thread testingThread = new Thread(new ThreadStart(threadTest.testThread()));
static void Main(string[] args)
{
}
Run Code Online (Sandbox Code Playgroud)
ThreadTest.cs
public static void testThread()
{
}
Run Code Online (Sandbox Code Playgroud) 我已经安装了.NET Framework 4.5,但我只能在我的项目中使用.NET Framework 4.0,它不支持BigInteger.我需要Visual Studio 2012 for 4.5还是Visual Studio 2010适合4.5?
以下代码抛出
'ConsoleApplication1.Program'的类型初始化程序引发了异常.
在线上
public static Regexp[] keepers = { ... };
Run Code Online (Sandbox Code Playgroud)
为什么这是错的,我该如何解决?
namespace ConsoleApplication1
{
class Program
{
public static String output = "";
public static Regex[] keepers = {
new Regex(@"using(?<everythingElse> [a-zA-Z.]+;)"),
new Regex(@"namespace(?<everythingElse> [a-zA-Z._]+)"),
new Regex(@"class(?<everythingElse> [a-zA-Z._]+)"),
new Regex(@"(public|private)? ?(static)? ?(?<type> String|void|int|Double)(" + Regex.Escape("[") + "?" + Regex.Escape("]") + "?" + "(?<functionName> [a-z_]+)(?<params> [^\r\n]+)")
};
[STAThread]
static void Main(string[] args)
{}}}
Run Code Online (Sandbox Code Playgroud) 我有以下代码,它将读取文件的字节,然后构造8个单独的字符串,一旦完成,8个字符串将拼凑在一起但是当读取500mb文件时,这段代码需要超过10个小时,然后我放弃运行它.
反正是在提高这段代码的效率,以便它可以更快地运行?
namespace ConsoleApplication1
{
public class object1
{
public static Byte[] split1 = new Byte[18082460];
public static Byte[] split2 = new Byte[18082460];
public static Byte[] split3 = new Byte[18082460];
public static Byte[] split4 = new Byte[18082460];
public static Byte[] split5 = new Byte[18082460];
public static Byte[] split6 = new Byte[18082460];
public static Byte[] split7 = new Byte[18082460];
public static Byte[] split8 = new Byte[18082452];
public static String[] output = new String[8];
public void run1()
{
for (int i = …Run Code Online (Sandbox Code Playgroud)