C#可再windows上安装吗

来源:百度知道 编辑:UC知道 时间:2024/09/20 18:37:59

上边的答复好像有点过头了吧。
好像只是问是否可以安装到Windows上而已!
答案是可以,只要是微软自己开发的东西,毫无疑问绝对可以安装到Windows上边。
只是Windows版本不同,可能需要附加安装一些东西!

两个字 可以

1、新建服务项目

比如

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Threading;
using System.Windows.Forms;
namespace CatchArticle
{
public class CatchArticle : System.ServiceProcess.ServiceBase
{
///
/// 必需的设计器变量。
///
private System.ComponentModel.Container components = null;
private Thread MainThread;
public CatchArticle()
{
// 该调用是 Windows.Forms 组件设计器所必需的。
InitializeComponent();

MainThread=new Thread(new ThreadStart(ThreadFunc));
MainThread.Priority=ThreadPriority.Lowest;
}

// 进程的主入口点
static void Main()
{
System.ServiceProcess.ServiceBase[] ServicesToRun;
Services