摘要: 物理路径就是磁盘路径,也就是说是在磁盘上的位置,虚拟路径也就是web页面上的路径,是相对于应用程序而言的 /// /// 将物理路径转换成相对路径 /// /// /// private string urlToVirtual(string imagesurl1) { //其实这里的tmpRootDir也等于tmpRootDir=Server.MapPath("~/"); string tmpRootDir = Serv... 阅读全文
posted @ 2013-07-02 22:25 shouqiang Wei 阅读(791) 评论(0) 推荐(0) 编辑
摘要: 在system.iO;命名空间中提供了两种遍历枚举文件夹的类,Directory 和DirectoryInfo,他们都有一个方法GetDirectories();来便利枚举文件夹, /// /// 遍历根目录 ,获取专业名称 /// /// public DataTable GetYearName(string path) { //string strYear = ""; DataTable tbYear = new DataTable("年份表"... 阅读全文
posted @ 2013-07-02 22:01 shouqiang Wei 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 读取pdf并且在web页面中显示if (System.IO.File.Exists(f)) { Response.ContentType = "applicationpdf"; System.IO.FileStream reader = System.IO.File.OpenRead(f); byte[] data = new byte[reader.Length]; reader.Read(data, 0, (int)reader.Length); reader.Close(); ... 阅读全文
posted @ 2013-07-02 21:54 shouqiang Wei 阅读(621) 评论(0) 推荐(0) 编辑
摘要: 先来张效果图gridview 中嵌套gridview的原理是这样的,在父gridview中建一个摸板列,然后再模版列当中在放入子gridview,然后再父gridview的OnRowDataBound事件中在对子gridview进行数据绑定,首先要获取子gridview的控制权,然后进行数据绑定 protected void gvList_RowDataBound(object sender, GridViewRowEventArgs e) { utils util=new utils(); HiddenField hf_year... 阅读全文
posted @ 2013-07-02 17:55 shouqiang Wei 阅读(275) 评论(0) 推荐(0) 编辑