Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load NotifyIcon1.Visible = True Timer1.Enabled = True Me.Hide() Me.ShowInTaskbar = False Left = (SystemInformation.WorkingArea.Size.Width - Size.Width) Top = (SystemInformation.WorkingArea.Size.Height - Size.Height) End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Me.Show() If tempCounter >= mailCount Then Timer1.Enabled = False Me.Hide() Else lblFrom.Text = "From : " & emailFrom(tempCounter) lblMessage.Text = "Subject : " & emailMessages(tempCounter) tempCounter += 1 End If End Sub Private Sub lblMessage_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lblMessage.TextChanged If lblMessage.Text = "" Then ElseIf lblMessage.Text = "" Then ElseIf lblMessage.Text = "" Then ElseIf lblMessage.Text = "" Then End If End Sub End Class Module GlobalVariables Public emailFrom(1), emailMessages(1) As String Public tempCounter As Int16 = 0 Public mailCount As Int16 = 0 End Module Imports System.Xml Imports System.Text Public Class LoginForm1 Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click End Sub Private Sub LoginForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load UsernameTextBox.Text = "madushka.prasad" PasswordTextBox.Text = "930400297v" Dim objClient As New System.Net.WebClient Dim nodelist As XmlNodeList Dim node As XmlNode Dim response As String Dim xmlDoc As New XmlDocument Try objClient.Credentials = New System.Net.NetworkCredential(UsernameTextBox.Text.Trim, PasswordTextBox.Text.Trim) response = Encoding.UTF8.GetString(objClient.DownloadData("https://mail.google.com/mail/feed/atom")) response = response.Replace("<feed version=""0.3"" xmlns=""http://purl.org/atom/ns#"">", "<feed>") xmlDoc.LoadXml(response) node = xmlDoc.SelectSingleNode("/feed/fullcount") mailCount = node.InnerText 'Get the number of unread emails If mailCount > 0 Then ReDim emailFrom(mailCount - 1) ReDim emailMessages(mailCount - 1) nodelist = xmlDoc.SelectNodes("/feed/entry") node = xmlDoc.SelectSingleNode("title") For Each node In nodelist emailMessages(tempCounter) = node.ChildNodes.Item(0).InnerText emailFrom(tempCounter) = node.ChildNodes.Item(6).ChildNodes(0).InnerText tempCounter += 1 Next tempCounter = 0 End If Me.Hide() Form1.Show() Catch ex As Exception MsgBox(ex.Message) End Try End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)