用ASP.NET写你自己的代码生成器(1)。

asp.net

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

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 name="GENERATOR" Content="Microsoft Visual Studio 7.0">
        <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="FrmMain" method="post" runat="server">
            <asp:TextBox id="txtServerName" style="Z-INDEX: 101; LEFT: 116px; POSITION: absolute; TOP: 24px; Design_Time_Lock: True" runat="server" Font-Size="10pt" Design_Time_Lock="True">192.168.0.220</asp:TextBox>
            <asp:Label id="Label7" style="Z-INDEX: 112; LEFT: 24px; POSITION: absolute; TOP: 98px; Design_Time_Lock: True" runat="server" Width="79px" Height="20px" Font-Size="10pt" Design_Time_Lock="True">数据库列表</asp:Label>
            <asp:Label id="Label6" style="Z-INDEX: 111; LEFT: 27px; POSITION: absolute; TOP: 169px; Design_Time_Lock: True" runat="server" Width="53px" Height="20px" Font-Size="10pt" Design_Time_Lock="True" Visible="False">字段名</asp:Label>
            <asp:Label id="Label5" style="Z-INDEX: 109; LEFT: 27px; POSITION: absolute; TOP: 135px; Design_Time_Lock: True" runat="server" Width="53px" Height="20px" Font-Size="10pt" Design_Time_Lock="True">表名</asp:Label>
            <asp:Button id="Button1" style="Z-INDEX: 107; LEFT: 496px; POSITION: absolute; TOP: 91px; Design_Time_Lock: True" runat="server" Width="102px" Text="GetTable" Font-Size="10pt" Design_Time_Lock="True"></asp:Button>
            <asp:Label id="Label4" style="Z-INDEX: 106; LEFT: 288px; POSITION: absolute; TOP: 63px; Design_Time_Lock: True" runat="server" Width="79px" Height="20px" Font-Size="10pt" Design_Time_Lock="True">密码</asp:Label>
            <asp:Label id="Label2" style="Z-INDEX: 105; LEFT: 25px; POSITION: absolute; TOP: 61px; Design_Time_Lock: True" runat="server" Width="79px" Height="20px" Font-Size="10pt" Design_Time_Lock="True">用户名</asp:Label>
            <asp:Label id="Label1" style="Z-INDEX: 104; LEFT: 25px; POSITION: absolute; TOP: 28px; Design_Time_Lock: True" runat="server" Width="79px" Height="20px" Font-Size="10pt" Design_Time_Lock="True">服务器名</asp:Label>
            <asp:TextBox id="txtPassword" style="Z-INDEX: 103; LEFT: 376px; POSITION: absolute; TOP: 60px; Design_Time_Lock: True" runat="server" Font-Size="10pt" BackColor="Transparent" ForeColor="Black" BorderColor="White" Design_Time_Lock="True"></asp:TextBox>
            <asp:TextBox id="txtUserName" style="Z-INDEX: 102; LEFT: 116px; POSITION: absolute; TOP: 62px; Design_Time_Lock: True" runat="server" Font-Size="10pt" Design_Time_Lock="True">sa</asp:TextBox>
            <asp:DropDownList id="DropDownList1" style="Z-INDEX: 108; LEFT: 115px; POSITION: absolute; TOP: 135px; Design_Time_Lock: True" runat="server" Width="208px" AutoPostBack="True" Font-Size="10pt" Design_Time_Lock="True"></asp:DropDownList>
            <asp:DropDownList id="DropDownList2" style="Z-INDEX: 110; LEFT: 115px; POSITION: absolute; TOP: 171px; Design_Time_Lock: True" runat="server" Width="208px" Height="28px" Font-Size="10pt" Design_Time_Lock="True" Visible="False"></asp:DropDownList>
            <asp:Button id="Button2" style="Z-INDEX: 113; LEFT: 355px; POSITION: absolute; TOP: 92px; Design_Time_Lock: True" runat="server" Width="107px" Text="GetDataBase" Design_Time_Lock="True"></asp:Button>
            <asp:DropDownList id="DropDownList3" style="Z-INDEX: 114; LEFT: 115px; POSITION: absolute; TOP: 98px; Design_Time_Lock: True" runat="server" Width="207px" Height="25px" Design_Time_Lock="True"></asp:DropDownList>
            <asp:Button id="Button3" style="Z-INDEX: 115; LEFT: 354px; POSITION: absolute; TOP: 132px; Design_Time_Lock: True" runat="server" Width="110px" Text="生 成" Design_Time_Lock="True" Visible="False"></asp:Button>
            <asp:TextBox id="txtLayOut" style="Z-INDEX: 117; LEFT: 26px; POSITION: absolute; TOP: 206px; Design_Time_Lock: True" runat="server" Width="619px" Height="367px" TextMode="MultiLine" BackColor="Ivory" Design_Time_Lock="True"></asp:TextBox>
            <asp:Button id="Button4" style="Z-INDEX: 118; LEFT: 497px; POSITION: absolute; TOP: 130px; Design_Time_Lock: True" runat="server" Height="25px" Width="105px" Text="实体类" Design_Time_Lock="True"></asp:Button>
            <asp:Button id="Button5" style="Z-INDEX: 119; LEFT: 355px; POSITION: absolute; TOP: 171px; Design_Time_Lock: True" runat="server" Width="107px" Text="Test" Height="25px" Design_Time_Lock="True" Visible="False"></asp:Button>
            <asp:Button id="Button6" style="Z-INDEX: 120; LEFT: 499px; POSITION: absolute; TOP: 171px; Design_Time_Lock: True" runat="server" Height="23px" Width="105px" Text="集合类" Design_Time_Lock="True" Visible="False"></asp:Button>
        </form>
    </body>
</HTML>

时间: 2024-10-27 01:47:41

用ASP.NET写你自己的代码生成器(1)。的相关文章

用ASP.NET写你自己的代码生成器(3)。

asp.net #region Make Form        /// <summary>        /// 生成表单项        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void Button3_Click(ob

用ASP.NET写你自己的代码生成器(2)。

asp.net FRMMAIN.ASPX.CS using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.WebCon

用asp.net写的论坛程序

asp.net|程序 这是一个用asp.net写的论坛程序,虽然简单但可以运行.这个程序的编程思想其实还是基本延续了asp的方式,如果让那只大鸟儿看见可能要嘘之以鼻.但实际上这种方式对于asp程序向asp.net的快速移植还是有用的.如果你对这种移植不屑那也没办法,这个贴子就算给asp.net刚入门的小虾们开开眼.这个例子包含3部分1)forum.aspx-论坛主页.2)reply.aspx-当在论坛主页中点击一个贴子时调用,显示贴子详细内容.3)postmessage.aspx-上贴时调用,将

asp net的作业-用ASP.NET写的学生信息管理系统的的源码和登录界面的源码

问题描述 用ASP.NET写的学生信息管理系统的的源码和登录界面的源码 麻烦哪位高人给我用ASP.NET写的学生信息管理系统的的源码和登录界面的源码,感谢感谢了,我们老师叫我们做,不然····,但是我不会,救救我吧,非常感谢,我邮箱1490223687@qq.com 解决方案 亲,你有了没?!有的话可以发给我么?!1121021242扣扣,拿到了 解决方案二: 请问你有这个资料了吗?能发一份吗?

框架-asp.net写得网页第一次打开为何会跳动一下

问题描述 asp.net写得网页第一次打开为何会跳动一下 网页是嵌在一个框架里面的,不知道为何初次打开会跳一下,第二次就不跳了,, 解决方案 你应该是哪里不小心设置 了刷新了,仔细看下代码

请问asp.net写的文件下载程序为什么用快车会把整个页面下载下来呢

问题描述 请问asp.net写的文件下载程序,在点击下载时,右键另存为没问题,可是为什么用快车下载时,在另存为框里是页面名称,如果不修改名称就会把整个页面下载下来呢?如何让另存为框里显示文件的名称而不是页面名称呢?请高手帮忙,谢谢. 解决方案 解决方案二:sf解决方案三:是不是点错地方了!第一次见你这类问题!解决方案四:我也是这头次遇到,没有点错地方解决方案五:有些网站限制了不能使用多线程下载,否则URL转向错误就会找不到下载文件直接把网页下载下来右键另存为其实网页做了转向,有的网站禁止多线程下

求大神把这段代码完成的功能用asp代码写出来

问题描述 求大神把这段代码完成的功能用asp代码写出来 protected void Button1_Click(object sender, System.EventArgs e) { XmlDocument doc = new XmlDocument(); String Account = TextBox1.Text.ToString(); String Password = TextBox2.Text.ToString(); String url = "http://3tong.net/h

一个网站程序是由asp.net写的,里面的代码大多数封装到了dll里面,dll能在被编译么!?又办法没?

问题描述 一个网站程序是由asp.net写的,里面的代码大多数封装到了dll里面,dll能在被编译么!?有办法没?

asp.net 写cookies与删除cookies代码

asp教程写cookie代码 '---------------------------------------------------------------- ' Name: WriteCookie(ByVal strCookieName As String, ByVal strKeyName As String, ByVal strKeyValue As String) ' Parameters: ' [ByVal] strCookieName - cookie名字 ' [ByVal] st