加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – “16位ms-dos子系统”错误

发布时间:2020-12-15 17:18:55 所属栏目:百科 来源:网络整理
导读:我编译这段代码,它没有错误.但是在命令提示符下运行EXE时,会出现错误“16位ms-dos子系统”错误对话框.我不知道为什么,因为在我更新我的 Windows XP之前,它运行得很好. 代码有什么问题吗? using System;using System.Collections.Generic;using System.Linq;
我编译这段代码,它没有错误.但是在命令提示符下运行EXE时,会出现错误“16位ms-dos子系统”错误对话框.我不知道为什么,因为在我更新我的 Windows XP之前,它运行得很好.

代码有什么问题吗?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Net;


namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var fromAddress = new MailAddress("aaa@gmail.com","System");           
            var toAddress = new MailAddress("bbb@gmail.com","Receiver");
            const string fromPassword = "xxx";

            const string subject = "Message";

            string body = args[0];


            var smtp = new SmtpClient
            {
                Host = "smtp.gmail.com",Port = 587,EnableSsl = true,DeliveryMethod = SmtpDeliveryMethod.Network,UseDefaultCredentials = false,Credentials = new NetworkCredential(fromAddress.Address,fromPassword)
            };
            using (var message = new MailMessage(fromAddress,toAddress)
            {
                Subject = subject,Body = body
            })
            {
                smtp.Send(message);
            }

        }
    }
}

解决方法

听起来你的XP更新可能没有正确完成或有问题.

Microsoft的这篇知识库文章解释了可能的修复:

http://support.microsoft.com/kb/324767

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读