熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

用ASP.NET寫你自己的代碼生成器

2022-06-13   來源: .NET編程 

  最近寫實體類集合類控制類什麼的太因此就花了點時間寫了個代碼生成器與大家共享!

  FRMMAINASPX

  <%@ Page language=c# Codebehind=FrmMainaspxcs AutoEventWireup=false   Inherits=Web_TestFrmMain %>
  <!DOCTYPE HTML PUBLIC //WC//DTD HTML Transitional//EN >
  <HTML>
     <HEAD>
        <title>FrmMain</title>
        <meta name=GENERATOR Content=Microsoft Visual Studio >
   <meta name=CODE_LANGUAGE Content=C#>
        <meta name=vs_defaultClientScript content=JavaScript>
        <meta name=vs_targetSchema content=>
     </HEAD>
     <body MS_POSITIONING=GridLayout>
        <form id=FrmMain method=post runat=server>
        <asp:TextBox id=txtServerName runat=server FontSize=pt Design_Time_Lock=True></asp:TextBox>
            <asp:Label id=Label runat=server Width=px Height=px FontSize=pt Design_Time_Lock=True>數據庫列表</asp:Label>
            <asp:Label id=Label runat=server Width=px Height=px FontSize=pt Design_Time_Lock=True Visible=False>字段名</asp:Label>

  <asp:Label id=Label runat=server Width=px Height=px FontSize=pt Design_Time_Lock=True>表名</asp:Label>
        <asp:Button id=Button runat=server Width=px Text=GetTable FontSize=pt Design_Time_Lock=True></asp:Button>
  <asp:Label id=Label runat=server Width=px Height=px FontSize=pt Design_Time_Lock=True>密碼</asp:Label>
        <asp:Label id=Label runat=server Width=px Height=px FontSize=pt Design_Time_Lock=True>用戶名</asp:Label>
        <asp:Label id=Label runat=server Width=px Height=px FontSize=pt Design_Time_Lock=True>服務器名</asp:Label>
            <asp:TextBox id=txtPassword runat=server FontSize=pt BackColor=Transparent ForeColor=Black BorderColor=White Design_Time_Lock=True></asp:TextBox>
            <asp:TextBox id=txtUserName runat=server FontSize=pt Design_Time_Lock=True>sa</asp:TextBox>

  <asp:DropDownList id=DropDownList runat=server Width=px AutoPostBack=True FontSize=pt  Design_Time_Lock=True></asp:DropDownList>
          <asp:DropDownList id=DropDownList runat=server Width=px Height=px FontSize=pt Design_Time_Lock=True Visible=False></asp:DropDownList>
          <asp:Button id=Button runat=server Width=px Text=GetDataBase Design_Time_Lock=True></asp:Button>
          <asp:DropDownList id=DropDownList runat=server Width=px Height=px Design_Time_Lock=True></asp:DropDownList>
          <asp:Button id=Button runat=server Width=px Text=生 成 Design_Time_Lock=True Visible=False></asp:Button>
          <asp:TextBox id=txtLayOut runat=server Width=px Height=px TextMode=MultiLine BackColor=Ivory Design_Time_Lock=True></asp:TextBox>
          <asp:Button id=Button runat=server Height=px Width=px Text=實體類 Design_Time_Lock=True></asp:Button>

  <asp:Button id=Button runat=server Width=px Text=Test Height=px Design_Time_Lock=True Visible=False></asp:Button>
         <asp:Button id=Button runat=server Height=px Width=px Text=集合類 Design_Time_Lock=True Visible=False></asp:Button>
          </form>
          </body>
          </HTML>


From:http://tw.wingwit.com/Article/program/net/201311/12535.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.