• 大小: 0.08M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-25
  • 语言: C#
  • 标签: 邮件  服务  

资源简介

通过注册服务,实现自动发送邮件

使用说明:

打开cmd
输入: 系统盘:\Windows\Microsoft.NET\Framework\v2.0.50727
输入:InstallUtil.exe 项目地址(如:InstallUtil.exe E:\Project\WServerSendEmail\WindowsServiceSendEmil\WindowsServiceSendEmil\bin\Debug\WindowsServiceSendEmil.exe)
会提示安装成功;
这时候右击我的电脑-管理-服务和应用程序-服务,在服务里面就可以找到Service1的服务,这个就是我们刚添加进去的.启动服务后就开始运行程序了;
如果你想调式,可以在vs里调式-附加到进程

卸载
打开cmd 
输入 sc delete 服务名称(如Service1)(注意:卸载前先停止服务)

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;

namespace WindowsServiceSendEmil
{
    static class Program
    {
        /// 
        /// 应用程序的主入口点。
        /// 

        static void Main()
        {
            Servicebase[] ServicesToRun;
            ServicesToRun = new Servicebase[] 

new Service1() 
};
            Servicebase.Run(ServicesToRun);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       8704  2010-07-17 14:15  WindowsServiceSendEmil\WindowsServiceSendEmil\bin\Debug\WindowsServiceSendEmil.exe

     文件      22016  2010-07-17 14:15  WindowsServiceSendEmil\WindowsServiceSendEmil\bin\Debug\WindowsServiceSendEmil.pdb

     文件      14328  2010-07-17 14:00  WindowsServiceSendEmil\WindowsServiceSendEmil\bin\Debug\WindowsServiceSendEmil.vshost.exe

     文件        964  2010-07-17 14:15  WindowsServiceSendEmil\WindowsServiceSendEmil\obj\Debug\WindowsServiceSendEmil.csproj.FileListAbsolute.txt

     文件        846  2010-07-17 14:15  WindowsServiceSendEmil\WindowsServiceSendEmil\obj\Debug\WindowsServiceSendEmil.csproj.GenerateResource.Cache

     文件       8704  2010-07-17 14:15  WindowsServiceSendEmil\WindowsServiceSendEmil\obj\Debug\WindowsServiceSendEmil.exe

     文件      22016  2010-07-17 14:15  WindowsServiceSendEmil\WindowsServiceSendEmil\obj\Debug\WindowsServiceSendEmil.pdb

     文件        180  2010-07-17 14:15  WindowsServiceSendEmil\WindowsServiceSendEmil\obj\Debug\WindowsServiceSendEmil.ProjectInstaller.resources

     文件        180  2010-07-17 14:15  WindowsServiceSendEmil\WindowsServiceSendEmil\obj\Debug\WindowsServiceSendEmil.Service1.resources

     文件        516  2010-07-15 14:48  WindowsServiceSendEmil\WindowsServiceSendEmil\Program.cs

     文件        399  2010-07-16 10:19  WindowsServiceSendEmil\WindowsServiceSendEmil\ProjectInstaller.cs

     文件       2006  2010-07-16 10:19  WindowsServiceSendEmil\WindowsServiceSendEmil\ProjectInstaller.Designer.cs

     文件       6413  2010-07-16 10:19  WindowsServiceSendEmil\WindowsServiceSendEmil\ProjectInstaller.resx

     文件       1376  2010-07-15 14:48  WindowsServiceSendEmil\WindowsServiceSendEmil\Properties\AssemblyInfo.cs

     文件       4847  2010-07-17 14:13  WindowsServiceSendEmil\WindowsServiceSendEmil\Service1.cs

     文件       1633  2010-07-15 16:37  WindowsServiceSendEmil\WindowsServiceSendEmil\Service1.Designer.cs

     文件       6193  2010-07-15 16:37  WindowsServiceSendEmil\WindowsServiceSendEmil\Service1.resx

     文件       3445  2010-07-16 10:19  WindowsServiceSendEmil\WindowsServiceSendEmil\WindowsServiceSendEmil.csproj

     文件        956  2010-07-15 14:48  WindowsServiceSendEmil\WindowsServiceSendEmil.sln

    ..A..H.     17920  2010-07-17 14:15  WindowsServiceSendEmil\WindowsServiceSendEmil.suo

     文件        495  2010-07-17 14:12  readme.txt

     目录          0  2010-07-15 15:07  WindowsServiceSendEmil\WindowsServiceSendEmil\obj\Debug\Refactor

     目录          0  2010-07-15 14:48  WindowsServiceSendEmil\WindowsServiceSendEmil\obj\Debug\TempPE

     目录          0  2010-07-17 14:15  WindowsServiceSendEmil\WindowsServiceSendEmil\bin\Debug

     目录          0  2010-07-17 14:15  WindowsServiceSendEmil\WindowsServiceSendEmil\obj\Debug

     目录          0  2010-07-16 10:16  WindowsServiceSendEmil\WindowsServiceSendEmil\bin

     目录          0  2010-07-15 14:48  WindowsServiceSendEmil\WindowsServiceSendEmil\obj

     目录          0  2010-07-15 14:48  WindowsServiceSendEmil\WindowsServiceSendEmil\Properties

     目录          0  2010-07-17 14:13  WindowsServiceSendEmil\WindowsServiceSendEmil

     目录          0  2010-07-15 14:48  WindowsServiceSendEmil

............此处省略43个文件信息

评论

共有 条评论