把生成圖片的代碼放在一個aspx頁面中
private void Page_Load(object sender
string code = Request
Bitmap image = DrawImage(code);
Response
image
Response
}
在需要引用圖片的地方
ImageCode
public class WebApp{
public static void ShowMessage(string message){
HttpContext
}
public static string CurrentUser{
get{
return HttpContext
}
}
}
public class Res {
public static StreamReader GetStream(Type type
//Assembly assembly = Assembly
Assembly assembly = type
Stream stream = assembly
return new StreamReader(stream);
}
}
public class ScriptControl : Control {
/// <summary>
/// Register Client Script Block
/// </summary>
/// <param name=
/// <param name=
public void RegisterScript(string scriptfile){
if (!this
StreamReader reader = Res
using(reader){
string script
=
+ reader
+
this
}
}
}
}
[DefaultProperty(
ToolboxData(
public class ShowDialogListBox : ScriptControl {
protected override void OnInit(EventArgs e) {
this
}
}
From:http://tw.wingwit.com/Article/program/net/201311/12428.html