问题描述
cl.cs文件usingSystem;usingSystem.Net;usingSystem.Data;usingSystem.IO;usingSystem.Drawing;usingSystem.Drawing.Imaging;usingSystem.Web;usingSystem.Web.UI;usingSystem.Web.UI.HtmlControls;usingSystem.Web.UI.WebControls;namespaceepttest{publicclassoutdata:System.Web.UI.Page{publicoutdata(){}boolThumbnailCallback(){returntrue;}publicstringGetFileName(stringpicdir,stringpicini){Response.Cookies["file_type"].Value="2";return"ddddddd";}}}编译:csc/t:library/out:cl.dll/R:dllsystem.dll/R:dllsystem.data.dll/R:dllsystem.web.dll/R:dllSystem.Drawing.dllcl.cs调用:<%@PageLanguage="c#"%><%@importNamespace="epttest"%><scriptrunat="server">voidPage_Load(objectsender,EventArgse){outdatacs=newoutdata();stringpicdir=Server.MapPath("Uploads/"+Request.Cookies["picdir"].Value);stringpicini=Server.MapPath("./pic.inc");stringhh=cs.GetFileName(picdir,picini);}</script><html><head>...当含有Response.Cookies["file_type"].Value="2";就出错!!高人帮忙啊!小弟多谢!
解决方案
解决方案二:
看看:Response.Cookies.Add(newHttpCookie("ftype","2"));查看你的浏览器是否支持COOKIE:Response.Write(HttpContext.Current.Request.Browser.Cookies.ToString());
解决方案三:
Response.Cookies["file_type"].Value="2";下面加上这句Response.Cookies["file_type"].expires=DateTime.Now.AddDays(1);stringpicdir=Server.MapPath("Uploads/"+Request.Cookies["ple_type"].Value);
解决方案四:
不行啊!好像dll含有网页控件都不行....高手啊进来吧!!!cl.cs文件usingSystem;usingSystem.Net;usingSystem.Data;usingSystem.IO;usingSystem.Drawing;usingSystem.Drawing.Imaging;usingSystem.Web;usingSystem.Web.UI;usingSystem.Web.UI.HtmlControls;usingSystem.Web.UI.WebControls;namespaceepttest{publicclassoutdata:System.Web.UI.Page{publicoutdata(){}boolThumbnailCallback(){returntrue;}publicstringGetFileName(){Response.Cookies["file_type"].Value="2";return"ddddddd";}}}编译:csc/t:library/out:cl.dll/R:dllsystem.dll/R:dllsystem.data.dll/R:dllsystem.web.dll/R:dllSystem.Drawing.dllcl.cs调用:<%@PageLanguage="c#"%><%@importNamespace="epttest"%><scriptrunat="server">voidPage_Load(objectsender,EventArgse){outdatacs=newoutdata();stringhh=cs.GetFileName();}</script><html><head>...当含有网页控件就出错!!