自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

等候、末班车

幸福就是当你坐在回家的车上,沿途欣赏着窗外的美景,依稀想起那些流失的岁月... ...

  • 博客(4)
  • 资源 (13)
  • 收藏
  • 关注

转载 Email邮件头揭密

 一、简介本文将详细讨论email头的方方面面。主要为用户架设邮件服务器提供理论基础并为管理员在出现电子邮件垃圾骚扰时提供发现垃圾邮件的真正源头。根据邮件头的知识有助于发现伪造的邮件。对于希望了解邮件是如何在网络中传输的用户同样会有帮助。文章有若干虚构的域名和随意分配的IP地址作为示例使用。二、Email的传输过程这部分包含一个简单的对一个电子邮件生命周期的分析。这对于理解邮件头能为你

2009-07-21 08:57:00 1014

原创 垃圾邮件的五大特性分析及应对技巧

对于垃圾邮件,已经在《中国互联网协会反垃圾邮件规范》中给出了一个明确的定义,但是它并不足以让我们了解垃圾邮件的产生、发送及其背后所隐藏的秘密。作为网管员或电子邮件用户,只有了解垃圾邮件所隐含的秘密,尤其是垃圾邮件发送者所使用的躲避垃圾邮件过滤的技术,才会知道垃圾邮件防范的具体细节在哪些方面。  一、垃圾邮件的产生流程及其背后的利益关系  垃圾邮件并不是无中生有的,对于纯商业性质的垃圾邮件来

2009-07-21 08:56:00 1589

原创 邮件发送的基本点

using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using

2009-07-21 08:50:00 285

转载 移动表格

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml">无标题文档html, body{    font-size:12px;}table{    border-collapse:collapse;}function $(id){    return document.getEle

2009-06-23 11:06:00 353

基于C#异步套接字的聊天程序DEMO

c#制作的聊天程序,可以实现QQ图像的发送,屏幕截取等QQ版的功能,希望对大家有帮助,仅供学习之用

2010-07-02

c#版新闻采集DEMO

一款不错的C#版新闻采集源码,供大家学习之用

2010-07-02

c#QQ农场偷菜源码

一款不错的C#版农场偷菜源码,仅供学习之用,请勿用来干其他的事情哈,学习的,所以共享

2010-07-02

c#无限加载的树形DEMO

C#无限级树形加载,直接运行可查看效果,以后直接放到项目中就可以使用啦,方便大家学习,共享啦

2010-07-02

c#邮件发送程序DEMO

一款很不错的邮件群发源码,可以实现邮件的群发,单发 希望对大家有帮助

2010-07-02

屏幕任意截取TeboScreen

C#写的一款截取任意屏幕大小的画面,可以保存截取的图片,不错的学习源码,希望对大家有帮助

2010-07-02

超强大黑客的任务管理器+C#源代码

c#写的一款很不错的任务管理器,比windows下的还有强大那么一点点,有服务,网络监控等,不错的学习源码

2010-07-02

c# 多线程(轮询,等待,回调)操作实例

c# 实现多线程的操作,轮询等待回调等异步操作,适合初学者的源码

2010-07-02

C#版模拟钢琴DEMO

c#完全模拟钢琴的效果,可以用键盘操作,一个很不错的源码

2010-07-02

Asp.net新闻采集器

新新闻采集 对一个网站进行新闻的采集包括标题.....

2009-05-11

ASP.NET绘图(GDI)

ASP.NET使用GDI+制作文字|图片水印 [ 2007-8-21 13:21:00 | By: SHARP_C ] 0 推荐System.Drawing.Image image = System.Drawing.Image.FromFile(@"D:\vista\cmd.jpg"); //注意Image的命名控件是System.Drawing.Image而不是System.Web.UI.HtmlControls.Image //在等号后不要使用关键字new,直接从文件创建背景图片 System.Drawing.Image sy = System.Drawing.Image.FromFile(@"D:\vista\723131486.jpg"); //创建要作为水印的图片 System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(image); //创建GDI+绘图图面 g.DrawString("本水印由sharp-c制作!", new System.Drawing.Font("隶书", 24), System.Drawing.Brushes.Blue, new System.Drawing.PointF(50, 20)); //在背景图片上绘制水印文字 g.DrawImage(sy,new System.Drawing.Point(400,300)); //在背景图片上绘制水印图片 image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg); //注意:这个很关键,没有就不能显示图片。其中ImageFormat取枚举值 image.Dispose(); g.Dispose(); //销毁对象 效果图如下:

2009-05-08

图片上传并按比例缩小

在ASP.NET中上传图片并生成缩略图的C#源码 <FONT size=4><FONT size=4><FONT size=4>using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.IO; using System.Drawing.Imaging; namespace eMeng.Exam { /// <summary> /// Thumbnail 的摘要说明。 /// </summary> public class Thumbnail : System.Web.UI.Page { protected System.Web.UI.WebControls.Label Label1; protected System.Web.UI.WebControls.Button Button1; private void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 Label1.Text = "<h3>在ASP.NET里轻松实炙趼酝?lt;/h3>"; Button1.Text = "上载并显示缩略图"; } #region Web 窗体设计器生成的代码 override protected void OnInit(EventArgs e) { // // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。 // InitializeComponent(); base.OnInit(e); } /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { this.Button1.Click += new System.EventHandler(this.Button1_Click); this.Load += new System.EventHandler(this.Page_Load); } #endregion private void Button1_Click(object sender, System.EventArgs e) { HttpFileCollection MyFileColl = HttpContext.Current.Request.Files; HttpPostedFile MyPostedFile = MyFileColl[0]; if (MyPostedFile.ContentType.ToString().ToLower().IndexOf("image") < 0) { Response.Write("无效的图形格式。"); return; } GetThumbNail(MyPostedFile.FileName, 100, 100, MyPostedFile.ContentType.ToString(), false, MyPostedFile.InputStream); } private System.Drawing.Imaging.ImageFormat GetImageType(object strContentType) { if ((strContentType.ToString().ToLower()) == "image/pjpeg") { return System.Drawing.Imaging.ImageFormat.Jpeg; } else if ((strContentType.ToString().ToLower()) == "image/gif") { return System.Drawing.Imaging.ImageFormat.Gif; } else if ((strContentType.ToString().ToLower()) == "image/bmp") { return System.Drawing.Imaging.ImageFormat.Bmp; } else if ((strContentType.ToString().ToLower()) == "image/tiff") { return System.Drawing.Imaging.ImageFormat.Tiff; } else if ((strContentType.ToString().ToLower()) == "image/x-icon") { return System.Drawing.Imaging.ImageFormat.Icon; } else if ((strContentType.ToString().ToLower()) == "image/x-png") { return System.Drawing.Imaging.ImageFormat.Png; } else if ((strContentType.ToString().ToLower()) == "image/x-emf") { return System.Drawing.Imaging.ImageFormat.Emf; } else if ((strContentType.ToString().ToLower()) == "image/x-exif") { return System.Drawing.Imaging.ImageFormat.Exif; } else if ((strContentType.ToString().ToLower()) == "image/x-wmf") { return System.Drawing.Imaging.ImageFormat.Wmf; } else { return System.Drawing.Imaging.ImageFormat.MemoryBmp; } } private void GetThumbNail(string strFileName, int iWidth, int iheight, string strContentType, bool blnGetFromFile, System.IO.Stream ImgStream) { System.Drawing.Image oImg; if (blnGetFromFile) { oImg = System.Drawing.Image.FromFile(strFileName); } else { oImg = System.Drawing.Image.FromStream(ImgStream); } oImg = oImg.GetThumbnailImage(iWidth, iheight, null, IntPtr.Zero); string strGuid = System.Guid.NewGuid().ToString().ToUpper(); string strFileExt = strFileName.Substring(strFileName.LastIndexOf(".")); Response.ContentType = strContentType; MemoryStream MemStream = new MemoryStream(); oImg.Save(MemStream, GetImageType(strContentType)); MemStream.WriteTo(Response.OutputStream); } } } </FONT></FONT></FONT><FONT color=#ff0000 size=4></FONT><FONT size=4>功能: 1。把图片文件(JPG GIF PNG)上传, 2。保存到指定的路径(在web.config中设置路径,以文件的原有格式保存), 3。并自动生成指定宽度的(在web.config中设置宽度) 4。和指定格式的(在web.config中指定缩略图的格式) 5。和原图比例相同的缩略图(根据宽度和原图的宽和高计算所略图的高度) 6。可以判断是否已经存在文件 7。如果不覆盖,则给出错误 8。如果选中"覆盖原图"checkbox,则覆盖原图。 9。可以根据要求,在webform上设置1个以上的file input和相应的checkbox 10。并在文件上传完毕后,显示原图的文件名,尺寸,字节,和 11。缩略图的文件名尺寸。 12。缩略图的文件名格式:原图+"_thumb."+指定格式,如:test.jpg_thumb.gif,以便于管理。 -------------------- public void UploadFile(object sender, System.EventArgs e) { string imgNameOnly, imgNameNoExt, imgExt; string imgThumbnail; int erroNumber = 0; System.Drawing.Image oriImg, newImg; string strFePicSavePath = ConfigurationSettings.AppSettings["FePicSavePath"].ToString(); string strFePicThumbFormat = ConfigurationSettings.AppSettings["FePicThumbFormat"].ToString().ToLower(); int intFeThumbWidth = Int32.Parse(ConfigurationSettings.AppSettings["FePicThumbWidth"]); string fileExt; StringBuilder picInfo = new StringBuilder(); if(Page.IsValid) { for(int i = 0;i < Request.Files.Count; i++) { HttpPostedFile PostedFile = Request.Files[i]; fileExt = (System.IO.Path.GetExtension(PostedFile.FileName)).ToString().ToLower(); imgNameOnly = System.IO.Path.GetFileName(PostedFile.FileName); if(fileExt == ".jpg" || fileExt == ".gif" || fileExt == ".png") { if(System.IO.File.Exists(strFePicSavePath + imgNameOnly) && (checkboxlistRewrite.Items[i].Selected == false)) { erroNumber = erroNumber + 1; picInfo.Append("<b>错误:</b>文件("+ (i+1) +") " + imgNameOnly + " 已经存在,请修改文件名<br/>" ); } } else { erroNumber = erroNumber + 1; picInfo.Append("<b>错误:</b>文件("+ (i+1) +") " + imgNameOnly + " 扩展名 " + fileExt + " 不被许可<br/>" ); } } if(erroNumber > 0) { picInfo.Append("<font color=red>全部操作均未完成,请修改错误,再进行操作</font><br/>"); } else { for(int i = 0;i < Request.Files.Count; i++) { HttpPostedFile PostedFile = Request.Files[i]; imgNameOnly = System.IO.Path.GetFileName(PostedFile.FileName); imgNameNoExt = System.IO.Path.GetFileNameWithoutExtension(PostedFile.FileName); imgExt = System.IO.Path.GetExtension(PostedFile.FileName).ToString().ToLower(); oriImg = System.Drawing.Image.FromStream(PostedFile.InputStream); newImg = oriImg.GetThumbnailImage(intFeThumbWidth, intFeThumbWidth * oriImg.Height/oriImg.Width,null,new System.IntPtr(0)); switch(imgExt) { //case ".jpeg": case ".jpg": oriImg.Save(strFePicSavePath + imgNameOnly , System.Drawing.Imaging.ImageFormat.Jpeg); break; case ".gif": oriImg.Save(strFePicSavePath + imgNameOnly , System.Drawing.Imaging.ImageFormat.Gif); break; case ".png": oriImg.Save(strFePicSavePath + imgNameOnly , System.Drawing.Imaging.ImageFormat.Png); break; } //oriImg.Save(ConfigurationSettings.AppSettings["FePicSavePath"] + imgNameNoExt + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); switch(strFePicThumbFormat) { //jpeg format can get the smallest file size, and the png is the largest size //case "jpeg": case "jpg": newImg.Save(strFePicSavePath + imgNameOnly + "_thumb.jpg",System.Drawing.Imaging.ImageFormat.Jpeg); imgThumbnail = imgNameOnly + "_thumb.jpg"; break; case "gif": newImg.Save(strFePicSavePath + imgNameOnly + "_thumb.gif",System.Drawing.Imaging.ImageFormat.Gif); imgThumbnail = imgNameOnly + "_thumb.gif"; break; case "png": newImg.Save(strFePicSavePath + imgNameOnly + "_thumb.png",System.Drawing.Imaging.ImageFormat.Png); imgThumbnail = imgNameOnly + "_thumb.png"; break; default: newImg.Save(strFePicSavePath + imgNameOnly + "_thumb.jpg",System.Drawing.Imaging.ImageFormat.Jpeg); imgThumbnail = imgNameOnly + "_thumb.jpg"; break; }//switch picInfo.Append("<b>文件 名:</b>" + imgNameOnly + " ( " + oriImg.Width + " x " + oriImg.Height + " ) " + PostedFile.ContentLength/1024 + "KB<br/>"); picInfo.Append("<b>缩略图名:</b>" + imgThumbnail + " ( " + newImg.Width + " x " + newImg.Height + " )<br/><br/>"); oriImg.Dispose(); newImg.Dispose(); }//for picInfo.Append("<font color=red>所有操作成功</font><br/>"); }// if erronumber = 0 } else { picInfo.Append("<font color=red>有错误,请检查。操作未成功</font><br/>"); } lblPicInfo.Text = picInfo.ToString(); } </FONT> 资料引用:http://www.knowsky.com/5723.html

2009-05-08

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除