0
我需要檢查圖像是否有像25px25p這樣的特殊信息,因此我不保存來自我們郵件(Xing,LinkedIn,Twitter等)的所有圖像。從郵件中檢索圖像的工作方式應該如何。EWS - 圖像大小/尺寸
我有一個小程序從服務器檢索電子郵件並將它們保存到數據庫。它還保存所有附件。必要的部分代碼如下:
else if (attachment is FileAttachment || attachment.IsInline)
{
FileAttachment fileAttachment = attachment as FileAttachment;
fileAttachment.Load();
string sfilename = fileAttachment.Name;
string sContentType = fileAttachment.ContentType;
using (var fs = new MemoryStream(fileAttachment.Content))
{
using (BinaryReader br = new BinaryReader(fs))
{
byte[] bytes = br.ReadBytes((int)fs.Length);
var oSQLConnection = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["..."].ConnectionString);
var cmd = new SqlCommand();
cmd.Connection = oSQLConnection;
cmd.CommandType = CommandType.Text;
string sTicketID = gTicketID.ToString() ?? string.Empty;
cmd.CommandText = "INSERT INTO TBL_Attachment (fkTicketID, fkMailID, FileName, ContentType, Data)VALUES('"+sTicketID+"', '"+snFile+"', '"+sfilename+"', '"+sContentType+"', @Data)";
var DataParameter = new SqlParameter("@Data", SqlDbType.Binary);
cmd.Parameters.Add(DataParameter);
DataParameter.Value = bytes;
.
.
.
我將文件轉換爲字節,並將其保存到數據庫中。
是否有可能獲得if語句的文件/圖像messurements?