简体   繁体   English

在Visual Studio 2012中进行调试时将IIS Express更改为全功能IIS

[英]Change IIS Express to full functions IIS when debug in Visual Studio 2012

In ASP.NET Unleashed book (SAMS Publishing, http://www.informit.com/store/asp.net-4-unleashed-9780672331121 ISBN-10: 0-13-256581-1 ) have a snippet: File: SendMail.aspx : 在ASP.NET Unleashed书(SAMS Publishing, http : //www.informit.com/store/asp.net-4-unleashed-9780672331121 ISBN-10:0-13-256581-1)中有一个代码段:File: SendMail .aspx

<%@ Page Language="C#" %>

<%@ Import Namespace="System.Net.Mail" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    void Page_Load()
    {
        SmtpClient client = new SmtpClient();
        client.Host = "localhost";
        client.Port = 25;
        client.Send("nate@somewhere", "nate@exclaimcomputing.com",
        "Beware!", "Watch out for zombies!");
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Send Mail</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            Email sent!
        </div>
    </form>
</body>
</html>

The book warning: "...sends the email by using the local SMTP Server. If your SMTP Server is not enabled, you receive the error An Existing Connection Was Forcibly Closed by the Remote Host. You can enable your local SMTP Server by opening Internet Information Services, right-clicking Default SMTP Virtual Server, and selecting Start." 本书警告: “ ...通过使用本地SMTP服务器发送电子邮件。如果未启用SMTP服务器,则会收到错误消息:远程主机强行关闭了现有连接。您可以通过以下方式启用本地SMTP服务器: Internet信息服务,用鼠标右键单击默认SMTP虚拟服务器,然后选择开始。”

By using Visual Sutio 2012, include built-in IIS Express, I can not practice this code, because IIS Express don't support SMTP. 通过使用Visual Sutio 2012(包括内置IIS Express),我无法练习此代码,因为IIS Express不支持SMTP。

Please help me change IIS Express to full function IIS to practice below snippet. 请帮助我将IIS Express更改为全功能IIS,以在以下代码片段中进行练习。

IIS Express is a version on Home/Family editions, not professional/Ultimate. IIS Express是家庭/家庭版的版本,不是专业/最终版。 If you don't have a Windows Pro/Ultimate you can install your own SMTP server, there are plenty of free good ones on the Web. 如果没有Windows Pro / Ultimate,则可以安装自己的SMTP服务器,网络上有很多免费的优质服务器。

But if you don't want to lost time to instal/configure an SMTP server for testing emails you can directly send emails from the .Net Framework. 但是,如果您不想浪费时间安装/配置SMTP服务器来测试电子邮件,则可以直接从.Net Framework发送电子邮件。

OK. 好。 So you installed IIS after .Net, so make sure that you've run aspnet_regiis.exe . 因此,您 .Net 之后安装了IIS,因此请确保已运行aspnet_regiis.exe

Now, right click your project, choose properties and follow these instructions from Microsoft. 现在,右键单击您的项目,选择属性,然后按照Microsoft的说明进行操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过Visual Studio 2012使用IIS Express时,无法识别resx更改 - When using IIS Express through Visual Studio 2012, resx changes are not recognized 从 iPad 连接到 Visual Studio (IIS Express) 时出现登录问题 - Login issue when connecting to Visual Studio (IIS Express) from iPad 在 Visual Studio 上通过 IIS Express 运行时可以加载图像,但通过 IIS 运行时无法加载 - Image can load when running by IIS Express on Visual studio, but can't load when running by IIS 使用IIS7无法对asp.net进行Visual Studio 2012调试 - visual studio 2012 debug for asp.net not working using IIS7 为什么IIS 8.0 Express在Visual Studio 2012中重命名后使用旧项目名称 - Why is IIS 8.0 Express using the old project names after rename in Visual Studio 2012 Visual Studio / IIS Express间歇性错误 - Visual Studio/IIS Express Intermittent Bugs Visual Studio 找不到 IIS Express - Visual Studio can't find IIS Express 使用IIS Express / Visual Studio进行SimpleInjector验证过程 - SimpleInjector Verification process with IIS Express / Visual Studio 在 Visual Studio 中运行 IIS-Express 时出错 - Error running IIS-Express in Visual Studio 无法使用Visual Studio 2015使用IIS Express调试ASP.NET 5 - Unable to debug ASP.NET 5 using IIS Express with Visual Studio 2015
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM