是什么净桌面应用程序和Web应用程序之间的技术区别是什么? [英] What are the technical difference between .Net desktop application and web applications?

查看:174
本文介绍了是什么净桌面应用程序和Web应用程序之间的技术区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始学习C#。

谁能解释一个.net桌面应用程序和Web应用程序之间的技术差异?

Can anyone explain the technical differences between a .Net desktop application and a web application?.

我的意思是,例如,如果我有使用一个WinForm一个简单的HelloWorld应用程序,有什么办法改变成一个HelloWorld Web应用程序所需的步骤?

I mean for example, if I have a simple HelloWorld application using a WinForm, what are the steps required to change that into a HelloWorld web application?

推荐答案

有没有真正的方式做一个公平的比较,因为这两个真的是像粉笔和奶酪。一个桌面应用程序有一个切入点,运行可执行文件,而一个Web应用程序有很多,你已经创建的每个.aspx页面中。

There's no real way to make a "fair comparison" as the two really are like "chalk and cheese". A desktop application has one "entry point", running the executable whereas a web application has many, each .aspx page that you've created.

有没有简单的方法来转换一个Hello World应用程序的UI / presentation模型是如此completley不同。一个典型的控制台应用程序是完全用code。使用 Console.WriteLine ,而web表单的应用程序,上面写着Hello World的完全可以写在asp.net标记。

There's no "easy" way to convert a "Hello World" application as the UI/presentation models are so completley different. A classic console application is entirely written in code using Console.WriteLine, whereas a webforms application that says "Hello World" can be written entirely in asp.net markup.

这是asp.net的Hello World应用程序可以很简单,比如一个名为Default.aspx的包含:

An asp.net "Hello World" application can be as simple as a file called default.aspx containing:

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
Hello, world!
    </form>
</body>
</html>

而控制台/桌面应用等同为:

Whereas the console/desktop application equivalent is:

using System;
namespace ConsoleHelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Hello World");
        }
    }
}

这篇关于是什么净桌面应用程序和Web应用程序之间的技术区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆