本文介绍了没有人告诉我是否要在文本框中输入名称,我想获取所有属性名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我什么也没告诉我
如果我要在文本框中输入名称,我想获取所有属性名称

am not getting any one tell me
if iwill enter name in textbox i want to get all attribute names

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using System.Xml.Linq;
using System.Text;
using System.IO;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
   
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        XmlTextReader reader = new XmlTextReader("C:\\Documents and Settings\\azhar\\Desktop\\flashrecorder.xml");
        XmlNodeType type;

        while (reader.Read()==true)
        {
            type = reader.NodeType;
            if (type == XmlNodeType.Element)
            {
                if (reader.Name == "PLAYER_SETTINGS")
                {
                   // reader.Read();
                    TextBox1.Text = reader.Value;

                }
                if (reader.Name == "PLAYER_SETTINGS")
                {
                   // reader.Read();
                    if(reader.GetAttribute("Name")=="SiteURL")
                    {
                        ListBox1.Items.Add(reader.GetAttribute("SiteURL"));
                    }
                    
                        

                }
              
                //reader.Close();
            }
        }
    }
        }


<CONFIG>
    <SETTINGS>
        <PLAYER_SETTINGS Name="License" Value="6b100nwghzms2cqk8v5prdjyf7t493"/>
        <PLAYER_SETTINGS Name="SiteURL" Value="http://irrex.ctco.lv:81/videocapture/"/>
        <PLAYER_SETTINGS Name="ServerURL" Value="rtmp://10.101.101.2:1935/oflaDemo/"/>
        <PLAYER_SETTINGS Name="FPS" Value="10" />
        <PLAYER_SETTINGS Name="AudioRate" Value="11"/>
        <PLAYER_SETTINGS Name="VideoWidth" Value="320"/>
        <PLAYER_SETTINGS Name="VideoHeight" Value="240"/>
        <PLAYER_SETTINGS Name="VideoCompression" Value="85"/>
        <PLAYER_SETTINGS Name="AudioGain" Value="50"/>
        <PLAYER_SETTINGS Name="SaveScript" Value="http://irr.ctco.lv/agjbrs/SaveVideoFile.aspx"/>
        <PLAYER_SETTINGS Name="AudioActivity" Value="50"/>
        <PLAYER_SETTINGS Name="VideoActivity" Value="50"/>
        <PLAYER_SETTINGS Name="MaxRecordingTime" Value="50"/>
        <PLAYER_SETTINGS Name="Color" Value="0x000077"/>
        <PLAYER_SETTINGS Name="EmbedURL" Value="http://irrex.ctco.lv/videocapture/player.swf"/>
        <PLAYER_SETTINGS Name="ShareURL" Value="http://irrex.ctco.lv/videocapture/share.aspx"/>
        <PLAYER_SETTINGS Name="LogoURL" Value="http://irrrx.ctco.lv/videocapture/logo.jpg"/>
        <PLAYER_SETTINGS Name="RedirectURL" Value="http://irrex.ctco.lv/agjbrs/Videorecorder.aspx?from=save"/>
        <PLAYER_SETTINGS Name="ShowLinkButton" Value="false"/>
    </SETTINGS>
    <MSG>
        <ERROR Name="Saving" Value="Saving file to the database..."/>
        <ERROR Name="SaveSuccess" Value="The file has been saved successfully"/>
        <ERROR Name="SaveError" Value="There was an error saving the file.Plz Check File size"/>

        <ERROR Name="NoMic" Value="You do not have a microphone installed"/>
        <ERROR Name="NoCam" Value="You do not have a camera installed"/>
    <ERROR Name="MaxRecordingTime" Value="Time limit"/>
    </MSG>
</CONFIG>



[edit]已添加代码块-OriginalGriff [/edit]



[edit]Code block added - OriginalGriff[/edit]

推荐答案


这篇关于没有人告诉我是否要在文本框中输入名称,我想获取所有属性名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 08:29