你的意思是要保存数据,下次启动记住上次关闭时的状态么?
 是这样的话,有很多种方法
1、最简单的,存为txt文件,下次启动时load进来赋值
2、搞个类,存放变量,将类序列化,启动时反序列化...
...
希望对你有点帮助

解决方案 »

  1.   

    我问的原因,主要是不想借助txt、mdb等等外部工具
      

  2.   

    google C# winforms 读写配置文件
      

  3.   

    <table style="width: 435px">
                            <tr>
                                <td colspan="3">
                                    <strong><span style="color: #993300" >&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                        &nbsp; 添加链接信息</span></strong></td>
                            </tr>
                            <tr>
                                <td style="width: 144px; text-align: right">
                                    <span style="font-size: 9pt">网址名称:</span></td>
                                <td colspan="2">
                                    <asp:TextBox ID="txtNmae" runat="server" Width="255px"></asp:TextBox></td>
                            </tr>
                            <tr>
                                <td style="width: 144px; height: 21px; text-align: right">
                                    <span style="font-size: 9pt">链接地址</span>:</td>
                                <td colspan="2" style="height: 21px">
                                    <asp:TextBox ID="txtUrl" runat="server" Width="255px"></asp:TextBox></td>
                            </tr>
                            <tr>
                                <td colspan="3" style="height: 21px; text-align: center">
                                    <asp:Button ID="btnOK" runat="server" Font-Size="9pt" OnClick="btnOK_Click" Text="添加" />
                                    <asp:Button ID="btnCancle" runat="server" Font-Size="9pt" Text="取消" OnClick="btnCancle_Click" /></td>
                            </tr>
                        </table>
      

  4.   

    <td style="width: 100px; height: 30px; text-align:center">
                        评论 ID:</td
                    <td style="width: 346px; height: 30px">
                        <asp:TextBox ID="txtGID" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="width: 100px; height: 30px; text-align: center">
                        评论者:</td>
                    <td style="width: 346px; height: 30px">
                        <asp:TextBox ID="txtGName" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="width: 100px; height: 30px; text-align: center">
                        评论标题:</td>
                    <td style="width: 346px; height: 30px">
                        <asp:TextBox ID="txtGType" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="width: 100px; height: 30px; text-align: center">
                        评论日期:</td>
                    <td style="width: 346px; height: 30px">
                        <asp:TextBox ID="txtGStore" runat="server"></asp:TextBox></td>
                </tr>
      

  5.   

    写配置文件也好,写ini文件也好,写txt文件也好,写数据库也好,你都要有个地方去记录你的设置,都要外部支持。