我必须在asp.net中编写此代码,任何人都告诉我 [英] i have to write this code in asp.net any one tell me

查看:66
本文介绍了我必须在asp.net中编写此代码,任何人都告诉我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用文本框,列表框和一个按钮在asp.net中编写tis代码.



i have to write tis code in asp.net by using textbox,listbox and one button



using System;
using System.Xml;

namespace ReadXMLfromFile
{
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    class Class1
    {
        static void Main(string[] args)
        {
            XmlTextReader reader = new XmlTextReader ("books.xml");
            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element: // The node is an element.
                        Console.Write("<" + reader.Name);
                        Console.WriteLine(">");
                        break;
                    case XmlNodeType.Text: //Display the text in each element.
                        Console.WriteLine (reader.Value);
                        break;
                    case XmlNodeType.EndElement: //Display the end of the element.
                        Console.Write("</" + reader.Name);
                        Console.WriteLine(">");
                        break;
                }
            }
            Console.ReadLine();
        }
    }
}



[edit]标记-OriginalGriff [/edit]



[edit]Tags - OriginalGriff[/edit]

推荐答案

您需要从其他类型的应用程序开始.
那是一个控制台应用程序-您需要从WinForms应用程序开始.

1)打开Visual Studio的新实例.
2)在开始页面上,单击新建项目"
3)在显示的对话框中,选择"C#",左侧的"Windows"和右侧的"Windows Forms Application".
4)给它取一个合理的名称,然后按确定"

现在,您可以将一个TextBox,一个ListBox和一个Button拖到您的窗体上.

现在,您需要做的就是将它们挂起来-但您的讲义应该涵盖这一点!
The you need to start with a different type of application.
That is a Console app - you need to start with a WinForms app.

1) Open a new instance of Visual Studio.
2) On the Start Page, click "New Project"
3) On the dialog that is displayed, select "C#", "Windows" on the left, and "Windows Forms Application" on the right.
4) Give it a sensible name, and press "OK"

You can now drag a TextBox, a ListBox and a Button onto your form.

Now, all you have to do is hook them up - but your lecture notes should cover that!


这篇关于我必须在asp.net中编写此代码,任何人都告诉我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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