1.建立一个class,ReadWriteConfig.cs using System;using System.Configuration;using System.Reflection;using System.Web;using System.Xml;public enum ConfigFileType} 2.建立测试页面2.1 html <HTML> <HEAD> <title>WebForm1</title> <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" Content="C#"> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> </HEAD> <body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 296px; POSITION: absolute; TOP: 120px" runat="server" Text="删除"></asp:Button> <asp:Button id="Button2" style="Z-INDEX: 102; LEFT: 232px; POSITION: absolute; TOP: 120px" runat="server" Text="新增"></asp:Button> <asp:Label id="Label1" style="Z-INDEX: 103; LEFT: 104px; POSITION: absolute; TOP: 32px" runat="server">key</asp:Label> <asp:TextBox id="TextBox1" style="Z-INDEX: 104; LEFT: 168px; POSITION: absolute; TOP: 32px" runat="server"></asp:TextBox> <asp:Label id="Label2" style="Z-INDEX: 105; LEFT: 104px; POSITION: absolute; TOP: 96px" runat="server">value</asp:Label> <asp:TextBox id="TextBox2" style="Z-INDEX: 106; LEFT: 168px; POSITION: absolute; TOP: 80px" runat="server"></asp:TextBox> <asp:Button id="Button3" style="Z-INDEX: 107; LEFT: 360px; POSITION: absolute; TOP: 120px" runat="server" Text="修改"></asp:Button> </form> </body></HTML> 2.2 cs代码 public class WebForm1 : System.Web.UI.Page } 3.测试代码下载/Files/singlepine/readwritconfig.rar 相关文章: