如何在网上使用C#代码和程序? [英] How can I use C# codes and programs on web?

查看:62
本文介绍了如何在网上使用C#代码和程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个html网页,我想用c#在其中做一些事情.我该怎么办?

I have a html web page and I want to do sometinghs in it with c#. What should I do?

推荐答案

C#不是一种解释语言.因此,您不能包括任何使用C#代码的脚本块.您必须使用JavaScript或VBScript之类的脚本语言.如果要使用C#,则只能在服务器端使用C#,则需要使用ASP.NET和IIS之类的Web服务器. C#代码在服务器上运行.客户端代码使用脚本语言运行.我相信可能会提供类似于C#的脚本语言,但是访问您网站的任何人都必须在本地计算机上安装脚本引擎,然后才能运行您的代码.

C# is not an interpreted language.  You therefore can not include any script blocks that use C# code.  You must use a scripting language like JavaScript or VBScript.  If you want to use C# then you are limited to using it on the server side and you'll need to use ASP.NET and a web server like IIS.  C# code runs on the server.  Client code runs using scripting languages.  I believe there might be a scripting language similar to C# available but anyone visiting your site would have to have the scripting engine installed on their local machine before your code would run.

作为替代方案,您可以创建一个ActiveX控件来执行您想要的操作,但是当您的用户访问您的页面时,他们将不得不安装ActiveX,而很多人将不再这样做.

As an alternative you could create an ActiveX control that does what you want but then your users would have to install the ActiveX when they visit your page and many people will not do that anymore.

迈克尔·泰勒(Michael Taylor)-06/6/12

Michael Taylor - 6/12/06


这篇关于如何在网上使用C#代码和程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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