Asp.net¶¯Ì¬×ª¾²Ì¬Ò³ÃæµÄÁ½ÖÖ·½·¨×ܽá
///Asp.net¶¯Ì¬×ª¾²Ì¬Ò³ÃæµÄÁ½ÖÖ·½·¨×ܽá
///ÓÉÓÚËÑË÷ÒýÇæ¶ÔaspxÒ³ÃæÊÕ¼ºÍhtmlÒ³ÃæµÄÊÕ¼ÂʵIJî±ðÒÔ¼°Ò³Ãæ×ÊÔ´Õ¼ÓÃÎÊÌ⣬ÎÒÃǺܶàʱºòÐèÒª
///ʵÏÖaspxÒ³Ãæ¶¯Ì¬×ª¾²Ì¬¡£Á½ÖÖÖ÷Á÷·½·¨ÈçÏ£º
///µÚÒ»ÕÅ·½·¨:
///ʹÓÃÄ£°åת»»£¬²½ÖèÈçÏ£º
///1£¬½¨Á¢Myconvert.cs ÀàÎļþ
using System;
//¼ÇµÃÌí¼ÓÒÔÏÂÈý¸öÒýÓÃ
using System.Text;
using System.Web;
using System.IO;
namespace TesConvert
{
///
///MyConvertµÄժҪ˵Ã÷¡£
///
public class MyConvert
{
public MyConvert()
{
//ÔÚ´ËÌí¼Ó¹¹Ô캯ÊýÂß¼
}
public bool WriteFile(string strText,string strContent,string strAuthor)
{
string path=HttpContext.Current.Server.MapPath("/TesConvert/news/");//¶¨ÒåhtmlÎļþ´æ·Å·¾¶
Encoding code=Encoding.GetEncoding("gb2312");//¶¨ÒåÎÄ×Ö±àÂë
//¶Áȡģ°åÎļþ
string temp=HttpContext.Current.Server.MapPath("TesConver/text.html");
StreamReader sr=null;
StreamWriter sw=null;
string str="";
try{
sr=new StreamReader(temp,code);
str=sr.ReadToEnd();//¶ÁÈ¡Îļþ
}catch(Exception exp){
HttpContext.Current.Response.Write(exp.Message);
HttpContext.Current.Response.End();
sr.Close();
}
string htmlfilename=path+DateTime.Now.ToString("yyyyMMddHHmmss")+".html";
//Ìæ»»ÄÚÈÝ
//Õâʱ£¬Ä£°åÎļþÒѾ¶ÁÈëµ½Ãû³ÆÎªstrµÄ±äÁ¿ÖÐÁË
str=str.Replace("ShowArticle",strText);//Ä£°åÒ³ÖеÄShowArticle
str=str.Replace("title",strText);
str=str.Replace("content",strContent);
str=str.Replace("author",strAuthor);
//дÎļþ
try{
sw=new Strea
Ïà¹ØÎĵµ£º
ÔÚasp.net 1.1ÖУ¬¶ÔÓÚÑéÖ¤Àà¿Ø¼þ£¬ÔÚʹÓÃʱ£¬Óöµ½ÓеIJ»ÐèÒªÑéÖ¤µÄ¿Ø¼þʱ£¬ÊÇÊ®·ÖÂé·³µÄ£¬¾ÍÊÇ˵²»¿ÉÄÜÓÐÑ¡ÔñÑé֤ijЩ¿Ø¼þ£¬¶øÔÚasp.net 2.0ÖУ¬ÐÂÔö¼ÓÁËvalidationgroupÊôÐÔ£¬¿ÉÒÔÖ¸¶¨Ñé֤ijЩ¿Ø¼þ£¬Àý×ÓÈçÏ£º
<html>
<body>
<form runat=“server”>
& ......
// °´Ä£°æ±ÈÀýÉú³ÉËõÂÔͼ£¨ÒÔÁ÷µÄ·½Ê½»ñȡԴÎļþ£©
//Éú³ÉËõÂÔͼº¯Êý
//˳Ðò²ÎÊý£ºÔ´Í¼ÎļþÁ÷¡¢ËõÂÔͼ´æ·ÅµØÖ·¡¢Ä£°æ¿í¡¢Ä£°æ¸ß
//×¢£ºËõÂÔͼ´óС¿ØÖÆÔÚÄ£°æÇøÓòÄÚ
public static void MakeSmallImg(System.IO.Stream fromFileStream,string fileSaveUrl,System.Double templateWidth,System.Double templateHeight)
{ ......
TreeView Web ·þÎñÆ÷¿Ø¼þ¿ÉÒÔÏÔʾ¸÷ÖÖ²»Í¬ÀàÐ͵ÄÊý¾Ý£º¿Ø¼þÖÐÒÔÉùÃ÷·½Ê½Ö¸¶¨µÄ¾²Ì¬Êý¾Ý£»°ó¶¨µ½¸Ã¿Ø¼þµÄÊý¾Ý£»»òΪÏìÓ¦Óû§²Ù×÷¶ø¶¯Ì¬Ìí¼Óµ½ TreeView ¿Ø¼þÖеÄÊý¾Ý¡£
Ò»¡¢ÏÔʾ¾²Ì¬Êý¾Ý
×î¼òµ¥µÄÊý¾Ý¼Ü¹¹ÊÇÉùÃ÷ÐÔ¾²Ì¬Êý¾Ý¡£ÈôҪʹÓÃÉùÃ÷ÐÔÓï·¨ÏÔʾ¾²Ì¬Êý¾Ý£¬Çë´´½¨Ò»¸ö TreeView ¿Ø¼þ× ......