Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS Network Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Network/Email Verification
This example is the version from Sat, 28th Feb 2014.
Project "Email Verification.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
EventHandler Sub Open()
me.ColumnAlignment(2) = me.AlignRight
End EventHandler
End Control
Control TextField1 Inherits TextField
ControlInstance TextField1 Inherits TextField
EventHandler Function KeyDown(Key As String) As Boolean
if asc(key) = 3 or asc(key) = 13 then
test TextField1.text
Return true
end if
End EventHandler
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
test TextField1.text
End EventHandler
End Control
Control Timer1 Inherits Timer
ControlInstance Timer1 Inherits Timer
EventHandler Sub Action()
for each t as WorkThread in threads
if t.done then
// find row
dim u as integer = List.ListCount-1
for i as integer = 0 to u
if list.RowTag(i) = t.id then
list.cell(i,1) = t.message
list.cell(i,2) = str(T.time, "0")
t.done = false
exit
end if
next
end if
next
End EventHandler
End Control
EventHandler Sub Open()
test "support@monkeybreadsoftware.de"
test "support monkeybreadsoftware.de"
test "support@monkeybreadsoftware2.de"
test "äöü@monkeybreadsoftware.de"
test "test@@@test.de"
End EventHandler
Sub Test(email as string)
// lookup can take some time, so we do it in a thread
static NewID as integer
NewID = NewID + 1
List.AddRow email
List.RowTag(List.LastIndex) = NewID
dim w as new WorkThread
w.id = NewID
w.email = email
w.run
Threads.Append w
End Sub
Property threads() As WorkThread
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
Class WorkThread Inherits Thread
EventHandler Sub Run()
dim start as Double = Microseconds
dim n as integer = VerifyEmailMBS(email, true)
if n = 0 then
message = "OK"
else
message = "Error "+str(n)
end if
dim endtime as Double = Microseconds
time = endtime - start
done = true
End EventHandler
Property ID As Integer
Property done As Boolean
Property email As string
Property message As string
Property time As Double
End Class
End Project
The items on this page are in the following plugins: MBS Network Plugin.