GDI+入门(九、ASP.NET中GDI+)
九、ASP.NET中GDI+
protected void Page_Load(object sender, EventArgs e)
{
string Filename;
System.Drawing.Image g;
Filename = Server.MapPath("./1.jpg");
g = System.Drawing.Image.fromFile(Filename);
Response.ContentType = "image/jpeg";
g.Save(Response.OutputStream, g.RawFormat);
g.Dispose();
}
实在是太简单了,不讲了吧
Response.ContentType = "image/jpeg";
Response.OutputStream
这两个地方很重中
WebServices中使用GDI+
[WebMethod]
public Byte[] DrawChart(int north, int east, int south, int west)
{
System.IO.MemoryStream outStream;
outStream = new System.IO.MemoryStream();
float thisAngle = 0;
float totalAngle = 0;
int width = 200;
int height = width;
int diameter = width - (width / 10);
int top = (height / 2) - (diameter / 2);
&n
相关文档:
在Web编程过程中,存在着很多安全隐患。比如在以前的ASP版本中,Cookie为访问者和编程者都提供了方便,并没有提供加密的功能。打开IE浏览器,选择“工具”菜单里的“Internet选项”,然后在弹出的对话框里单击“设置”按钮,选择“查看文件”按钮,在弹出的窗口中,就会显示硬盘里 ......
1、给web.config添加<authentication>元素
2、给web.config文件添加<forms>元素
<forms name=".aspxauth" loginUrl="Login.aspx" protection="All" timeout="30" path="/" requireSSL="false" slidingExpiration="true" cookieless="UseDeviceProfile"></forms>
3、FormsAuthentication.Redire ......
使用ASP.NET开发网站时,如果URL中传递的参数过长(具体多长没有测试)的话,在使用IE6浏览时,就会出现通过QueryString获得的值不完整,或者出现乱码的情况。其解决方法是:在Web.config中的System.web配置节中添加如下代码即可:
<globalization requestEncoding="gb2312" responseEncoding="gb2312" ......
ImportCatalogPart Web 服务器控件可导入 WebPart 控件的说明文件(或用作 WebPart 控件的其他 ASP.NET 服务器控件)。这样就可以将该控件通过预先指定的设置添加到网页中。该说明文件使用户可以共享 WebPart 控件的设置。
说明文件与控件本身不同。它是以 .WebPart 文件扩展名结尾的 XM ......