判断操作系统版本

  If (Environment.OSVersion.Platform <> PlatformID.Win32NT) Then
            Throw New PlatformNotSupportedException(SR.GetString("RequiresNT"))
        End If
        If ((Environment.OSVersion.Version.Major >= 7) OrElse ((Environment.OSVersion.Version.Major = 6) AndAlso (Environment.OSVersion.Version.Minor >= 1))) Then
            Throw New PlatformNotSupportedException(SR.GetString("SmtpMail_not_supported_on_Win7_and_higher"))
        End If
        If (Environment.OSVersion.Version.Major <= 4) Then
            CdoNtsHelper.Send(from, [to], subject, messageText)
        Else
            CdoSysHelper.Send(from, [to], subject, messageText)
        End If
posted on 2011-07-11 15:36  西湖浪子  阅读(193)  评论(0)    收藏  举报