易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net对图片的读写

 写图片c:\1.jpg到表cinfo中
private static void AddCinfo()
    {
        string strSql = "insert into cinfo (srvtitle,csttitle,introduction,logo) values
(@srvtitle,@csttitle,@introduction,@logo)";
        SqlParameter[] parms =
        {
            new SqlParameter("@srvtitle",SqlDbType.VarChar,30),
            new SqlParameter("@csttitle",SqlDbType.VarChar,30),
            new SqlParameter("@introduction",SqlDbType.NVarChar,500),
            new SqlParameter("@logo",SqlDbType.Image)
        };
        parms[0].Value = "旅业互动";
        parms[1].Value = "lyhd";
        parms[2].Value = "简介";
        string filePath = @"c:\1.jpg";
        FileStream fs = File.OpenRead(filePath);
        byte[] content = new byte[fs.Length];
        fs.Read(content, 0, content.Length);
        fs.Close();
        parms[3].Value = content;
        DBHelper.ExecuteNonQuery(CommandType.Text, strSql, parms);
    }
读取图片的页面 test.aspx
protected void Page_Load(object sender, EventArgs e)
    {
        string strSql = "select * from cinfo where id=1";
        SqlDataReader reader=DBHelper.ExecuteReader(CommandType.Text, strSql, null);
 


相关文档:

asp.net 回执(postback)后定位问题

用asp.net 的回执(postback)是很爽,但若一个长长的页面,一回执后,跳到了页首,体验不爽。 但在asp.net的page页面里面有一个很爽的属性Page.MaintainScrollPositionOnPostBack 属性,设为true即可。 获取或设置一个值,该值指示回发后是否将用户返回到客户端浏览器中的同一位置。 <%@ Page Title="" Lang ......

asp.net form标签嵌套 提交页面的解决方法


原帖地址:http://blog.cnria.com/post/aspnet-form-e5b58ce5a597-e68f90e4baa4e9a1b5e99da2e79a84e8a7a3e586b3e696b9e6b395-from-e5b58ce5a597-aspnet-e8a1a8e58d95.aspx
这个问题的原因其实并不是asp.net 运行机制的原因,而是因为在html中本身就不允许form标签嵌套使用,我试过document.getelementbyid("search&q ......

优秀ASP.NET程序员的修炼之路


<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体" ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号