Posted April 01, 2006 12:00AM by Robert Smith
Tagged: Coding
Long time issue... for years now, how time flies... with McAfee VirusScan 8 is that a .Net dialog will lose its text. So if you make a .Net forms app and you pop up a MessageBox there will be a blank caption, blank message area and even the button(s) will have no text. This was confirmed back with .Net 1 as being incorrect behavior from McAfee. They admitted it. They never fixed it. The workaround is to right click on the little McAfee Shield icon in your task tray, click on Console, look to the list of tasks then disable Buffer Overflow Protection. Fine. Stupid and apparently never going to be fixed but fine. Kept hitting another darned thing and tracked down the issue ? McAfee VirusScan 8.0. In .Net 1.x you send a mail using this kind of static/shared line:
System.Web.Mail.SmtpMail.Send(txtFrom.Text, txtTo.Text, txtSubject.Text, txtBody.Text);
Optionally you can set a lot of stuff but if your local machine has an SMTP Service running you can do simple SendMail. Under the covers that line is calling on CDO. With .Net 2.0 you have more options that include not using CDO under the covers and instead using fully "managed pipes?. To get that the code changes to the new namespace/objects:
System.Net.Mail.SmtpClient c = new System.Net.Mail.SmtpClient();
c.Host = txtSMTPServer.Text;
c.Send(txtFrom.Text, txtTo.Text, txtSubject.Text, txtBody.Text);
Fine. Until you try to run that on a machine with McAfee VirusScan 8 with the default options. That code on such a machine will be blocked. McAfee considers it to be a ?Worm Attack? Bottom lines: a) If you need to do a simple SendMail using .Net 2.0 and CDO is properly installed on the target machine (still a very likely situation for typical OSes) you can still use the System.Web.Mail CDO wrapper and ignore the compiler warning. b) If you want to cut down the COM loads or need the new added .Net security abilities or just want to get rid of those yellow compiler flags and McAfee is on the target machine then you have to Right click on the tray icon, click on Properties, double click on the ?Access protection? item and uncheck the Mass Mailing Worms port 25 block. To be fair, McAfee isn't alone on this, Norton can stop Managed Pipe emails too... but that .Net-Age-old text issue makes me riled so I'll nag it on their head ;-) Robert Smith
Kirkland, WA |