http://www.ourfly.com/forum/View.aspx?fbId=7&Id=313
解决方案 »
- 我电脑上又有sql2000,又有sql2005,为什么2005连不上数据库?
- 求助 无法导入windows media player控件
- 关于ASP.NET异常的问题
- 如何读取某字段的部分内容??
- 提个高难度问题,给分200,请看要求:
- 还是OWC:同样的类,同样的调用方法,同样的数据,用WEB测试跟用Console测试画出来的图居然不一样!!!!
- 在框架中,left页面有一个treeview,在指定的宽度显示不完,当鼠标指向treeview时,能给出hint提示,不知如何实现?
- 能提供者有分
- 请问这样的问题如何解决?
- 如何得到正在编辑状态的一个列的值
- 用asp.net+c#+sql server2000这样的工作岗位工资能有多少呀??
- 点击datagrid的edit或select按扭时,如何使被点选的这行变色?
我一直很关注这个问题,只是在.net中不知道如何做?
{
private Bitmap m_Image;
private string m_Text; public ValidationImage(string Text, Font font, Color ForeColor, Color BackgroundColor)
{
// Create a bitmap so we can create the Grapics object
Bitmap bm = new Bitmap(1,1);
Graphics gs = Graphics.FromImage(bm); // Resize the bitmap so the width and height of the text
bm = new Bitmap(Convert.ToInt32(gs.MeasureString(Text, font).Width),Convert.ToInt32(gs.MeasureString(Text, font).Height)); // Render the bitmap
gs = Graphics.FromImage(bm);
gs.Clear(BackgroundColor);
gs.TextRenderingHint = TextRenderingHint.AntiAlias;
gs.DrawString(Text, font, new SolidBrush(ForeColor), 0, 0);
gs.Flush(); // Set the properties
m_Image = bm;
m_Text = Text;
} // Public Properties
public Bitmap Image {
get { return m_Image; }
} public string Text {
get { return m_Text; }
}
}
File Upload with ASP.NET
http://www.codeproject.com/aspnet/FileUpload.asp
string fn = Server.MapPath(@"/1.jpg");
System.IO.FileStream fs=new System.IO.FileStream(fn,FileMode.Create,FileAccess.Write);
fs.WriteByte(bytes); //生成文件
fs.Flush;
fs.Close();Response.Redirect("/1.jpg");
o.GetThumbnailImage(宽,高,null,IntPtr.Zero);