用ASP.NET写你自己的代码生成器

2015 年 1 月 5 日3110

 最近写实体类集合类控制类什么的太“类”了,因此就花了点时间写了个代码生成器,与大家共享!

  FRMMAIN.ASPX

  <%@ Page language="c#" Codebehind="FrmMain.aspx.cs" AutoEventWireup="false"   Inherits="Web_Test.FrmMain" %>
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  <HTML>
 <HEAD>
<title>FrmMain</title>
<meta Content="Microsoft Visual Studio 7.0">
  <meta Content="C#">
<meta content="JavaScript">
<meta content="http://http://www.zjjv.com///intellisense/ie5">
 </HEAD>
 <body MS_POSITIONING="GridLayout">
<form method="post" runat="server">
<asp:TextBox runat="server" Font-Size="10pt" Design_Time_Lock="True">192.168.0.220</asp:TextBox>
<asp:Label runat="server" Font-Size="10pt" Design_Time_Lock="True">数据库列表</asp:Label>
<asp:Label runat="server" Font-Size="10pt" Design_Time_Lock="True" Visible="False">字段名</asp:Label>
  <asp:Label runat="server" Font-Size="10pt" Design_Time_Lock="True">表名</asp:Label>
<asp:Button runat="server" Text="GetTable" Font-Size="10pt" Design_Time_Lock="True"></asp:Button>
  <asp:Label runat="server" Font-Size="10pt" Design_Time_Lock="True">密码</asp:Label>
<asp:Label runat="server" Font-Size="10pt" Design_Time_Lock="True">用户名</asp:Label>
<asp:Label runat="server" Font-Size="10pt" Design_Time_Lock="True">服务器名</asp:Label>
<asp:TextBox runat="server" Font-Size="10pt" BackColor="Transparent" ForeColor="Black" BorderColor="White" Design_Time_Lock="True"></asp:TextBox>
<asp:TextBox runat="server" Font-Size="10pt" Design_Time_Lock="True">sa</asp:TextBox>
  <asp:DropDownList runat="server" AutoPostBack="True" Font-Size="10pt"  Design_Time_Lock="True"></asp:DropDownList>
<asp:DropDownList runat="server" Font-Size="10pt" Design_Time_Lock="True" Visible="False"></asp:DropDownList>
<asp:Button runat="server" Text="GetDataBase" Design_Time_Lock="True"></asp:Button>
<asp:DropDownList runat="server" Design_Time_Lock="True"></asp:DropDownList>
<asp:Button runat="server" Text="生 成" Design_Time_Lock="True" Visible="False"></asp:Button>
<asp:TextBox runat="server" TextMode="MultiLine" BackColor="Ivory" Design_Time_Lock="True"></asp:TextBox>
<asp:Button runat="server" Text="实体类" Design_Time_Lock="True"></asp:Button>
  <asp:Button runat="server" Text="Test" Design_Time_Lock="True" Visible="False"></asp:Button>
<asp:Button runat="server" Text="集合类" Design_Time_Lock="True" Visible="False"></asp:Button>
</form>
</body>
</HTML>

查看本文来源

0 0