我知道,我知道,我可能把你弄糊涂了!:)
我有这个:
namespace WebPageHeaderFixer
{
class Program
{
static void Main(string[] args)
{
string folderToSearch = @"C:\Test\";
foreach (string file in Directory.GetFiles(folderToSearch))
{
string fileString = File.ReadAllText(file);
//Here, I want to insert string X into "fileString" AFTER string Y.
}
}
}
}
我想在 LAST Register TagPrefix 之后将字符串 X 添加到变量 fileString 中:
<%@ Register TagPrefix="ucCal" TagName="popupCalendar" Src="../UserControls/popupCalendar.ascx" %>
<%@ Register TagPrefix="ucRes" TagName="Search" Src="../UserControls/SearchControl.ascx" %>
<%@ Register TagPrefix="abc" TagName="header" Src="../Header.ascx" %>
//I want to insert X here
other code
some more code
some ugly code
我该怎么做呢?
*请注意,文件之间的最后一个注册标签可能不同。