Login  

Blog Stats

News


Visual Developer - Visual Basic MVP

隨筆分類

文章分類

每月文章

優質好站連結


強力鎯頭 の VB 部落

您好 ! 歡迎蒞臨 Power Hammer 的 VB 部落 ! 網誌內容主要為 VB .Net C# WMI 等相關資訊 , 提供網友參考

如何取得 Outlook Express 裡使用者所設定的 E-Mail 信箱帳號

 

從登錄檔中讀取

HKCU\Software\Microsoft\Internet Account Manager\Accounts\00000001
HKCU\Software\Microsoft\Internet Account Manager\Accounts\00000002
依此類推

 

VB.Net 寫法  :           

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    MessageBox.Show (GetEmailBox)

End Sub

 

Private Function GetEmailBox() As String

    Dim strKey As String = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\"

    Dim bytLoop As Byte

    On Error Resume Next

    With CreateObject("WScript.Shell")

        For bytLoop = 1 To 255

            GetEmailBox &= .RegRead(strKey & Format(bytLoop, "00000000") & "\SMTP Email Address") & vbCrLf

            If Err.Number > 0 Then Exit For

        Next

    End With

End Function

 

 

================================================================

 

 

VB6 寫法  :

 

Dim strMail As String

Dim objWshShell As Object

Dim bytLoop As Byte

Set objWshShell = CreateObject("WScript.Shell")

On Error Resume Next

With objWshShell

     For bytLoop = 1 To 255

          strMail = strMail & .RegRead("HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & _

                        Format(bytLoop, "00000000") & "\SMTP Email Address") & vbCrLf

          If Err Then Exit For

     Next

End With

Set objWshShell = Nothing

MsgBox strMail

 

posted on Sunday, June 18, 2006 1:41 AM

What People Are Saying About This Post...

# re: 如何取得 Outlook Express 裡使用者設定的 E-Mail 信箱帳號 8/30/2006 3:24 PM a09190486@yahoo.com.tw
會員確認信


# vb如何调用 Outlook Express 自动发送邮件 9/12/2006 11:45 AM pwb20002
sdfsdf


# re: 如何取得 Outlook Express 裡使用者設定的 E-Mail 信箱帳號 9/12/2006 2:51 PM Hammer
參考看看嚕

Private Const strOE = "C:\Progra~1\Outloo~1\msimn.exe"

Private Sub Command1_Click()

Dim strSubject As String, strBody As String
Dim strCC As String, strBCC As String
Dim strTo As String

strSubject = "主旨"
strTo = "haha@nooneknows.com"
strCC = "ADer@msn.com"
strCC = """omg""<haha@nooneknows.com>;""Power omg""<whois@msa.hinet.net>"
strCC = "omg;ADer"
strBCC = "whois@msa.hinet.net"
strBody = "信件內容"

Shell strOE & " " & GetMail2str(strTo, strSubject, strCC, strBCC, strBody), vbNormalFocus

End Sub

Private Function GetMail2str(strTo As String, strSubject As String, strCC As String, strBCC As String, strBody As String) As String
GetMail2str = "/mailurl:mailto:" & strTo & "?subject=" & strSubject & "&cc=" & strCC & "&bcc=" & strBCC & "&body=" & strBody
End Function


# re: 如何取得 Outlook Express 裡使用者設定的 E-Mail 信箱帳號 12/14/2006 11:15 AM 硬盘数据恢复
不错~

# re: 如何取得 Outlook Express 裡使用者設定的 E-Mail 信箱帳號 1/8/2009 10:09 AM House moving
筆者高明

What do you have to say?

Title:
Name:
Url:
驗證碼  
Comments: