Login Register






Problem with stub and builder filter_list
Author
Message
Problem with stub and builder #1
Hello. I have maybe little problem for all of you but for me it's big, i'm beginner in vb .net. Exactly i have two files. Builder and stub. In builder i have two textboxes, how can i do that text from this textboxes land in some line in stub code. Example, i have stub with code:
Code:
Imports System Imports System.Net.Mail Imports System.Threading Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim smtpServer As New SmtpClient() Dim mail As New MailMessage() smtpServer.Credentials = New Net.NetworkCredential("zibixxxxxx@gmail.com", "xxxxxxxxxxxxx") smtpServer.Port = 587 smtpServer.Host = "smtp.gmail.com" smtpServer.EnableSsl = True mail = New MailMessage() mail.From = New MailAddress("zibixxxxxxx@gmail.com") mail.To.Add("zibixxxxxxx@gmail.com") mail.Subject = TextBox1.Text mail.Body = TextBox2.Text smtpServer.Send(mail) End Sub End Class

and i want to replace email and pass from this line
Code:
smtpServer.Credentials = New Net.NetworkCredential("zibixxxxxx@gmail.com", "xxxxxxxxxxxxx")
with text from builder textboxes. Please help me, this is very important for me. Sorry for my very bad englishSmile Thanks for all answers.

Reply

RE: Problem with stub and builder #2
Can't you just do the following? (in stub)

Code:
Net.NetworkCredential(emailAddress, "xxxxxxxxxxxxx")

Where emailAddress is a private/public (I don't care) variable... how to assign the address?
Code:
sub public void assignAddress(address As string) Me.emailAddress = address end sub

or, I think that you can just access it if it is public directly, notice that you can pass the address from Builder like this:
Code:
myStub.emailAddress(myBuilder.textbox1.text)

notice that myBuilder is an instance of Builder, and myStub is an instance of Stub

[note] I don't actually speak VB!
[Image: wvBFmA5.png]

Reply