I\'ve found several aspx codes for forms which include the use of a \"Set\" function. When I try them out on the hosting server, I get an error message that \"Set is no lon
Some things to remember for .Net:
Option Infer
linq typesIn fact, in .Net you can get rid probably of the CDONTS dependancy entirely, as .Net has a built-in mail support:
Dim smtp As New System.Net.SmtpClient()
Dim message As New System.Net.MailMessage(EmailFrom, EmailTo, Subject, Body)
smtp.Send(message)
If you mean the VB6 syntax
Set obj = new Object
then you can simply remove the Set
obj = new Object()
Set is a keyword in VB6, with the intrudction of VB.NET the keyword, as used in this context, was removed.
Formerly, Set was used to indicate that an object reference was being assigned (Let was the default). Because default properties no longer are supported unless they accept parameters, these statements have been removed.
Module Module1
Sub Main()
Dim person As New Person("Peter")
Dim people As New People()
people.Add(person)
'Use the default property, provided we have a parameter'
Dim p = people("Peter")
End Sub
End Module
Public Class People
Private _people As New Dictionary(Of String, Person)
Public Sub Add(ByVal person As Person)
_people.Add(person.Name, person)
End Sub
Default Public ReadOnly Property Person(ByVal name As String) As Person
Get
Return _people(name)
End Get
End Property
End Class
Public Class Person
Private _name As String
Public Sub New(ByVal name As String)
_name = name
End Sub
Public ReadOnly Property Name() As String
Get
Return _name
End Get
End Property
End Class