为什么我的事件.load无法找到? [英] Why can't my event .load be found?
问题描述
我正在尝试通过电子邮件将自己提供的信息发送给自己。目标是让人们输入帐户信息,该信息将发送给稍后可以更新数据库的员工。这是我到目前为止的代码,但我遇到了handle myBase.load的问题,其中无法找到事件加载。有谁知道可能有什么问题?
旁注:我知道我应该在网络凭据中添加一些内容,但我不想将我的电子邮件和密码添加到发布。
预先感谢您的帮助。
我的尝试:
进口System.Net.Mail
部分班级签名
Private Sub signUp_Load(ByVal sender As Object,ByVal e As System.EventArgs)处理MyBase.load
End Sub
Private Sub Button1_Click(发送者为对象,e为EventArgs)处理btnSubmit.Click
Dim Smtp_Server作为新的SmtpClient
Dim e_mail作为新MailMessage()
Smtp_Server。 UseDefaultCredentials = False
Smtp_Server.Credentials = New Net.NetworkCredential(,)
Smtp_Server.Port = 587
Smtp_Server.EnableSsl = True
Smtp_Server.Host =smtp.gmail.com
e_mail =新MailMessage()
e_mail.From =新邮件地址(txtUsername.Text)
e_mail.To.Add(TextBox2.Text)
e_mail.Subject =客户帐户信息
e_mail.IsBodyHtml = False
e_mail.Body = txtUsername.Text
Smtp_Server.Send(e_mail)
End Sub
结束类
您的signUp
类没有明确的基类,所以它基于对象类(系统) [ ^ ]没有加载
方法。
I am trying to send information people provide in a form in an email to myself. The goal is to have people enter in account information which will be sent to an employee who can later update a database. Here is the code behind I have so far but I am having an issue with my "handles myBase.load" in which it says "the event load cannot be found". Does anyone know what may be wrong?
Sidenote: I know I am supposed to add something in network credentials but I did not want to add my email and password to a post.
Thanks in advance for your help.
What I have tried:
Imports System.Net.Mail
Partial Class signUp
Private Sub signUp_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click
Dim Smtp_Server As New SmtpClient
Dim e_mail As New MailMessage()
Smtp_Server.UseDefaultCredentials = False
Smtp_Server.Credentials = New Net.NetworkCredential("", "")
Smtp_Server.Port = 587
Smtp_Server.EnableSsl = True
Smtp_Server.Host = "smtp.gmail.com"
e_mail = New MailMessage()
e_mail.From = New MailAddress(txtUsername.Text)
e_mail.To.Add(TextBox2.Text)
e_mail.Subject = "Client Account Information"
e_mail.IsBodyHtml = False
e_mail.Body = txtUsername.Text
Smtp_Server.Send(e_mail)
End Sub
End Class解决方案YoursignUp
class does not have an explicit base class so it is based on the Object Class (System)[^] which does not have aload
method.
这篇关于为什么我的事件.load无法找到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!