我使用的代码:
System.Net.Mail.MailAddress address = new System.Net.Mail.MailAddress("testî╥@mail.com");
从VS2010中删除相同的代码,抛出FormatException。但是当从VS2012执行时,它不会抛出任何异常。
堆栈追踪:
at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset, String& displayName)
at System.Net.Mail.MailAddress.ParseValue(String address)
at System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding)
at System.Net.Mail.MailAddress..ctor(String address)
at HP.Imaging.Wjp.AppCommon.EmailManager.EmailAddress.TryParse(String addressString, MailAddress& address) in ..\EmailAddress.cs:line 325
我找不到这个问题的原因。请帮我找到解决方案。