c# aspx 动态编译文件模板
2008-06-26 12:11
225 查看
模板一:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<body>
<script language="C#" runat="server">
Response.Write("hello");
</script>
</body>
</html>
模板二:
<%@ Page Language="C#" %>
<% @Import Namespace="System.Drawing" %>
<% @Import Namespace="System.IO" %>
<% @Import Namespace="System.Drawing.Imaging" %>
<HTML>
<HEAD>
<title>test</title>
</HEAD>
<body>
<%
StringBuilder str =new StringBuilder();
//str.Append("<html><head><title> test</title></head><body>");
str.Append(" <h1> <div> hello world !!!</div></h1>");
//str.Append("<script>alert('hello')</script>");
System.IO.DirectoryInfo d= new DirectoryInfo("c:/");//Server.MapPath(".")
System.IO.FileInfo[] f = d.GetFiles();
foreach(FileSystemInfo ff in d.GetFileSystemInfos())
{
//str.Append(ff.FullName+"-----------" + ff.Extension+ff.Name+"<br/>");
}
str.Append( Request.UserHostAddress);
str.Append(this.Request.UserAgent);
string s=this.Request.ServerVariables.ToString();
str.Append( s );
//str.Append("</body></html>");
Response.Expires = 0;
Response.ClearContent();
Response.ContentType = "text/html";
Response.Write(str.ToString());
Response.End();
%>
</body>
</HTML>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<body>
<script language="C#" runat="server">
Response.Write("hello");
</script>
</body>
</html>
模板二:
<%@ Page Language="C#" %>
<% @Import Namespace="System.Drawing" %>
<% @Import Namespace="System.IO" %>
<% @Import Namespace="System.Drawing.Imaging" %>
<HTML>
<HEAD>
<title>test</title>
</HEAD>
<body>
<%
StringBuilder str =new StringBuilder();
//str.Append("<html><head><title> test</title></head><body>");
str.Append(" <h1> <div> hello world !!!</div></h1>");
//str.Append("<script>alert('hello')</script>");
System.IO.DirectoryInfo d= new DirectoryInfo("c:/");//Server.MapPath(".")
System.IO.FileInfo[] f = d.GetFiles();
foreach(FileSystemInfo ff in d.GetFileSystemInfos())
{
//str.Append(ff.FullName+"-----------" + ff.Extension+ff.Name+"<br/>");
}
str.Append( Request.UserHostAddress);
str.Append(this.Request.UserAgent);
string s=this.Request.ServerVariables.ToString();
str.Append( s );
//str.Append("</body></html>");
Response.Expires = 0;
Response.ClearContent();
Response.ContentType = "text/html";
Response.Write(str.ToString());
Response.End();
%>
</body>
</HTML>
相关文章推荐
- 【转】C#生成dll文件:如何用C#编译生成dll文件即动态链接库文件供其它程序调用
- 重写代码生成器支持模板(多层架构,MVC),多语言c#,java;支持mysql和sqlserver,动态编译
- 在C#中动态编译T4模板代码
- c#动态编译,自己做了个c#脚本管理框架,可以作为其他应用的插件使用。增强程序的拓展性
- 如何让一个动态链接库文件debug和release编译的时候生成不同的文件名
- 动态代理---动态生成java文件并编译成class文件
- 把aspx文件编译成DLL文件
- C#利用定时任务插件实现在后台线程中批量把动态文件生成静态文件方法
- 如何用C#动态编译、执行代码
- C#代码动态编译、动态执行、动态调试
- 使用HttpHandler功能,把aspx文件编译进dll
- C# 动态编译及反射执行
- 如何用GCC编译出动态库文件(*.so)
- asp.net 网站模板怎么用,就是16aspx上面下下来的模板,里面有个sln文件,其他全是文件夹的东西
- 根据html页面模板动态生成html页面(c#类)
- C# aspx页面动态加载ascx用户控件 及 利用反射调用
- c#上利用NPlot实现动态曲线图需要的dll文件
- OpenWrt 内核编译制作ipk动态更新文件
- 抽取VS文件组成类GCC的编译器,并编译C程序为dll动态链接库
- 把aspx文件编译成DLL文件