使用引用system.windows.forms时出错; [英] Error on using reference system.windows.forms;
问题描述
我想在我的网络应用中使用messagebox.show()
但是给了我这个错误:
编译器错误消息:CS0234:类型或命名空间名称''Windows''在命名空间''系统'中不存在(你是否缺少程序集引用?)
源错误:
第8行:使用System.Configuration;
第9行:使用System.Data;
第10行:使用System.Windows.Forms;
第11行:
第12行:命名空间Csharp
< blockquote>网络不支持以这种方式显示消息框。 C#代码在服务器上运行并生成HTML,然后发送到客户端,然后浏览器呈现HTML。如果要向用户显示消息,则需要使用JavaScripts 警报 [ ^ ]或使用jQuery插件。
I want to use messagebox.show("") in my web app
but gives me this error:
Compiler Error Message: CS0234: The type or namespace name ''Windows'' does not exist in the namespace ''System'' (are you missing an assembly reference?)
Source Error:
Line 8: using System.Configuration;
Line 9: using System.Data;
Line 10: using System.Windows.Forms;
Line 11:
Line 12: namespace Csharp
The web will not support showing a messagbox this way. The C# code runs on the server and generates HTML which is sent to the client and then the browser renders the HTML. If you want to show a message to the user you need to use JavaScripts alert[^] or use a jQuery plugin.
这篇关于使用引用system.windows.forms时出错;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!