windows 服务弹框
思想进行中 2011-08-15 04:20:46 请问下。windows服务可以弹框不啊?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Collections;
using System.Runtime.InteropServices;
using System.Data.SqlClient;
namespace Demo_Base
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private Thread MainThread;
private void Form1_Load(object sender, EventArgs e)
{
//实例化线程
MainThread = new Thread(new ThreadStart(ThreadFunc));
// MainThread.Priority = ThreadPriority.Lowest;
//string nowdate = System.DateTime.Now.ToString();
}
/// <summary>
/// 开启服务后循环运行程序
/// </summary>
private void ThreadFunc()
{
while (true)
{
//暂停线程6秒
System.Threading.Thread.Sleep(6000);
// DataExecute.ExecuteNonQuery(CommandType.Text, "insert into T_ServerShow values('王五')");
MessageBox.Show("哈哈", "", MessageBoxButtons.OK);这个弹框不能实现。。
}
}
}
}
我这样写的一个弹框。没一点反应呜。。
请问下大家windows 服务能弹框吗?如果能正确的应该怎么写呃、劳驾大家了嘎啦。。