using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
namespace new_app
{
 
/// <summary>
 
/// myxml 的摘要说明。
 
/// </summary>

 public class myxml : System.Web.UI.Page
 
{

  
private void Page_Load(object sender, System.EventArgs e)
  
{
   
// 在此处放置用户代码以初始化页面  

   write_file();



  }

  
public void write_file()
  
{
   
string filename="file.js";
   DateTime dtstr 
= DateTime.Now;
   
string fileNameString = MapPath(filename);
   Regex r 
= new Regex(" ");
   Regex r2 
= new Regex("-");
   Regex r3 
= new Regex(":");
   
string[] s = r.Split(dtstr.ToString()); 
   
string[] s2 = r2.Split(s[0]);
   
string[] s3 = r3.Split(s[1]); 
   
string qname=s2[0]+s2[1]+s2[2]+s3[0]+s3[1]+s3[2]+".htm";
   
string fileNameString2 = MapPath(qname);
   
string errString = "我的盐城热线!";
   
string correctString = errString.Replace("热线""信息港");
   Response.Write(correctString);
   
string mydoc="document.write(\"<a href=\"http://www.ycinfo.com/" target=\"_blank\">盐城信息港</a><br>\");";
   
string mydoc2="<a href=\"http://www.ycinfo.com/" target=\"_blank\">盐城信息港"+"</a>";
   
//StreamWriter sr = File.CreateText(FILE_NAME);
   StreamWriter sr = File.CreateText(fileNameString);
   StreamWriter sr2 
= File.CreateText(fileNameString2);
   sr.WriteLine (mydoc);
   sr2.WriteLine (mydoc2);
   sr.Close();
   sr2.Close();
  }

  
Web 窗体设计器生成的代码
 }

}


 
posted on 2007-02-06 09:38  mbskys  阅读(141)  评论(0)    收藏  举报