日期:2014-05-17 浏览次数:20827 次
static void Main(string[] args)
{
string input = "my default";
Task.Factory.StartNew(() => { input = Console.ReadLine(); }).Wait(10 * 1000);
Console.WriteLine(input);
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Windows.Forms;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string s = "";
bool inputted = false;
System.Threading.Timer t = new System.Threading.Timer(new TimerCallback(o => { if (!inputted) SendKeys.SendWait("{enter}"); }), null, 10 * 1000, 0);
s = Console.ReadLine();
inputted = true;
Console.WriteLine(s);
}
}
}