Overblog Suivre ce blog
Editer l'article Administration Créer mon blog
27 mai 2008 2 27 /05 /mai /2008 14:20

 

Les imports :

Code :

Imports System.Configuration
Imports System.Net.Configuration
Imports System.Web.Configuration

Le code :

Code :

Dim configurationFile As Configuration = WebConfigurationManager.OpenWebConfiguration(My.Application.Info.DirectoryPath & "Web.config")
Dim mailSettings As MailSettingsSectionGroup = configurationFile.GetSectionGroup("system.net/mailSettings") 
Dim port As Integer 
Dim host As String 
Dim password As String 
Dim username As String

If Not mailSettings Is Nothing Then
                port = mailSettings.Smtp.Network.Port
                host = mailSettings.Smtp.Network.Host
                password = mailSettings.Smtp.Network.Password
                username = mailSettings.Smtp.Network.UserName
End If

Partager cet article

Repost 0
Published by Cyril - dans ASP.NET
commenter cet article

commentaires