|
You may want to copyright that
only two letters away from being an asset
|
|
|
|
|
Im trying to add a new feature in the "Image Processing for Dummies with C# and GDI+ Part 2 - Convolution Filters" system.
the problem is that i get this error
A first chance exception of type 'System.InvalidOperationException' occurred in System.Drawing.dll
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Drawing.dll
Additional information: Bitmap region is already locked.
the error occurs in the following line
g.DrawImage(m_Bitmap, new Rectangle(this.AutoScrollPosition.X, this.AutoScrollPosition.Y, (int)(m_Bitmap.Width*Zoom), (int)(m_Bitmap.Height * Zoom)));
any help will be appreciated
|
|
|
|
|
Make sure you call UnlockBits on m_Bitmap before calling DrawImage.
Eslam Afifi
|
|
|
|
|
livewirerules wrote: Im trying to add a new feature in the "Image Processing for Dummies with C# and GDI
|
|
|
|
|
how can i send an email with an Attachments of zip/rar file?
I write this code :
<code>System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
System.Net.NetworkCredential cred = new System.Net.NetworkCredential("username@gmail.com", "password");
mail.To.Add("username@gmail.com");
mail.Subject = "Subject";
mail.From = new System.Net.Mail.MailAddress("username@gmail.com");
mail.IsBodyHtml = true;
mail.Body = filename;
mail.Attachments.Add(new Attachment(@"c:\1.zip",MediaTypeNames.Application.Zip));
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com");
smtp.UseDefaultCredentials = false;
smtp.EnableSsl = true;
smtp.Credentials = cred;
smtp.Port = 587;
smtp.Timeout = 1000000;
smtp.Send(mail);</code>
The size of the file "1.zip" is 500kb and i get this message:
{"Exceeded storage allocation. The server response was: 5.7.0 Our system detected an illegal attachment on your message. Please"}
Can someone please help to solve this issue?
|
|
|
|
|
shai sherman wrote: The size of the file "1.zip" is 500kb and i get this message:
{"Exceeded storage allocation. The server response was: 5.7.0 Our system detected an illegal attachment on your message. Please"}
As the error message suggests, the error is a response from the other end of the email: the recipient server.
The remote server will not accept the message, the most probable reason being the size of the attachment (from the "Exceeded storage allocation" part.)
Try breaking the .zip file into smaller segments and send them with different messages.
Or try sending the .zip file with a different extension to see if the server lets that through (your user will have to rename it, tho.)
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
so there is no way to send just one file of zip/rar to gmail server?
|
|
|
|
|
Yeah, you can get the technicians who manage the gmail servers to allow zip/rar files to be attached to emails. But not likely you will get that to happen so...
and I'm pretty sure gmail does not accept zip/rar files of any size for security reasons
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Untrue it checks the files within the zips and blocks the attachment only if an unsafe file is contained within.
I email myself zip files or projects all the time, but I have to exclude any executables.
|
|
|
|
|
Yeah that makes more sense
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
in my experience it is sufficient to modify the extension, gmail doesn't mind a ZIP that contains an executable called TEST.EXF (nor an unpackaged TEST.EXF).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
No. I just checked: Gmail attachments[^]
GMail will not accept .ZIP files, unless you rename them.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Incorrect,
The source link you quoted wrote: In Gmail, you can't send executable files (.exe, .cmd) or ZIP archives that contain executables. To bypass this limitation, you need to rename the file and change its extension (don't forget to mention this to the person that receives your mail).
So zip's can be used, but cannot contain executables.
|
|
|
|
|
I did notice that, but since gmail is complaining and his file is well under the 10MB limit, I felt pretty certain his .ZIP did. You were right though - I should have mentioned it.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
The problem is the extension not the file size. Gmail detects within your zip contains an executable file which is unsafe to send over an email for obvious reasons.
To bypass this rename your zip extension to something customer (myzip.ggg) and have the recipient rename the extension back to .zip.
shai sherman wrote: mail.Attachments.Add(new Attachment(@"c:\1.zip",MediaTypeNames.Application.Zip));
Also, don't specify the Application.Zip.
|
|
|
|
|
|
Thank you very much
|
|
|
|
|
Hey All,
I was just wondering if it's at all possible to update/add extra functionality to my applications using DLL's? I haven't done this before, and haven't found an answer to this elsewhere. Does anybody know anything about this?
Thanks,
Jase
modified on Sunday, July 12, 2009 8:45 AM
|
|
|
|
|
Umm, if it's your DLL you should have the source code to modify at your pleasure..
|
|
|
|
|
|
Thank yuo very much for your help mark and eliott, it was really helpful.
|
|
|
|
|
Hi bros,
Is there any way in C# (C/C++) to detect a timezone observes DST time or not.
For example: with timezone GMT+7, it does not observe DST; timezone GMT-6 observes DST time.
Anyone knows please help me.
Many thanks,
SA.
|
|
|
|
|
Try MSDN for TimeZoneInfo.IsDaylightSavingTime
If the time zone represented by the TimeZoneInfo object does not support daylight saving time, the method always returns false.
You may have to jigger with it to check a date / time combo that would be in DST if the time zone did support it.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Thanks for your answer.
I've had a look at TimeZoneInfo but is only for Microsoft Visual Studio 2008/.NET Framework 3.5 or higher. My current application is in Microsoft Visual Studio 2005/.NET Framework 2.0. It's my pain . I'm sorry not include the version of .Net framework in my question
Is there any other way?.
|
|
|
|
|
TimeZone class has the same method for .Net 2.0
|
|
|
|