protected void Button1_Click(object sender, EventArgs e)
{
foreach (string file in Directory.GetFiles(Server.MapPath("img")))
{
File.Delete(file);
}
int i = 1;
foreach (string file in Directory.GetFiles(Server.MapPath("7")))
{
if (file.Substring(file.LastIndexOf(".") + 1) == "jpg")
{
File.Copy(file, "I:\\WebSite3\\img\\img0" + i.ToString() + ".jpg", true);
i = i + 1;
}
} string str2 = "9.swf"; string str1 = Application["str"].ToString();
File.Copy(Server.MapPath(str1), Server.MapPath(str2));
File.Delete(Server.MapPath(str1));
Application["str"] = str2.ToString ();
a.InnerHtml = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='800' height='470'><param name='movie' value='" + str2 + "'/><param name='quality' value='high' /> <embed src='" + str2 + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='800' height='470'></embed></object>"; }
protected void Button2_Click(object sender, EventArgs e)
{
foreach (string file in Directory.GetFiles(Server.MapPath("img")))
{
File.Delete(file);
}
int i = 1;
foreach (string file in Directory.GetFiles(Server.MapPath("6")))
{
if (file.Substring(file.LastIndexOf(".") + 1) == "jpg")
{
File.Copy(file, "I:\\WebSite3\\img\\img0" + i.ToString() + ".jpg", true);
i = i + 1;
}
}
string str2 = "10.swf"; string str1 = Application["str"].ToString(); File.Copy(Server.MapPath(str1), Server.MapPath(str2));
File.Delete(Server.MapPath(str1));
Application["str"] = str2.ToString ();
a.InnerHtml = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='800' height='470'><param name='movie' value='" + str2 + "'/><param name='quality' value='high' /> <embed src='" + str2 + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='800' height='470'></embed></object>";
}
我的总体意思就是a.InnerHtml中的a是一个div标签,代码的总体意思就是
button1事件是先删除img下的文件,再将同目录的6文件夹下文件复制到img文件夹下,
string str1 = Application["str"].ToString(); File.Copy(Server.MapPath(str1), Server.MapPath(str2));
File.Delete(Server.MapPath(str1));
就是修改swf文件名,button1事件后生成的HTML文档中,flash标签中的src变成了9.swf
可是在button2事件后,src的标签虽然变成了10.swf(img下的图片已经变了,flash读取img的图片) ,可是为什么还是先前的flash呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货