开发者

"16-bit ms-dos subsystem" error

I compile this code, it has no error. But when run the EXE in command prompt, error "16-bit ms-dos subsystem" error dialog box appears. I don't know why because before I update my Windows XP, it works just fine.

Is there anything wrong with the code?

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 Mail开发者_StackOverflow中文版Address("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);
            }

        }
    }
}


It sounds like your XP update may have not completed properly or had an issue.

This KB article from Microsoft explains possible fixes:

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


What the bloody? It sounds like you took a really bad update or something. It shouldn't be recognizing a .NET exe as 16 bit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜