ASP.NET中高质量缩略图的生成代码
private Size NewSize(int maxWidth, int maxHeight, int width, int height){double w = 0.0;double h = 0.0;double sw = Convert.ToDouble(width);double sh =
private Size NewSize(int maxWidth, int maxHeight, int width, int height){double w = 0.0;double h = 0.0;double sw = Convert.ToDouble(width);double sh =
bitmap.Save(imgPath,ImageFormat.Jpeg);//这是保存缩略图的一段代码,其中的ImageFormat.Jpeg一定不能省略,即使你保存的文件本来就是jpg格式的,也不能去掉。因为如果去掉的话,生成的缩略图比原始图片还要大! //另外,imgPath必须首先创建,否则
以前用日期作为字符串时,我这么写: string sDate = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToStri
在 Page_Load 中写入下面代码: string s=base.QueryString("usctrl") ; string uc= (s== String.Empty) ? "~/myweb/userctrl/default.ascx":"~/myweb/userctrl/""+ s + "
一个日期加上或减去一个值 (比如年份): DateTime newDate = DateTime.Now.AddYears(2);//加 DateTime newDate = DateTime.Now.AddYears(-2);//减两个日期相减 DateTimedate1=newDateTime(
文件上传 HttpPostedFile postFile = Request.Files["imgFile"]; if(postFile.FileName!=String.Empty){ex=postFile.FileName.Substring(postFile.FileName.LastInde
ASP.NET提供三种主要形式的缓存:页面级输出缓存、用户控件级输出缓存(或称为片段缓存)和缓存API。 尽早缓存;经常缓存 您应该在应用程序的每一层都实现缓存。向数据层、业务逻辑层、UI或输出层添加缓存支持。内存现在非常便宜-因此,通过以智能的方式在整个应用程序中实现缓存,可以获得很大的性能提高
实际上是利用.Net中的Process对象来实现的。string str=@"d:\test.avid:\test_allen.flv";RunFFMpeg(str);//运行FFMpeg的视频解码,public void RunFFMpeg(string strCmd){//创建并启动一个新进程P
min.aspx实现代码如下:实现代码如下: td,table,tr {list-style: none;font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 12px;line-height: 180%; } input
可能"极好的"又会带来很多的非议,但是我认为这确实很好,我看了大约20个无刷新的连动下拉列表,他们在firefox下面就一团糟.为了这个我差不多搞了两天,就是如果提交窗体后如何保持第二个列表框的值,因为通过js 给下拉框添加条目那么他的状态是不会被保存的测试平台:ie6,firefox功能:二级无刷