Welcome to Dream.In.Code
Become a VB Expert!

Join 137,270 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,447 people online right now. Registration is fast and FREE... Join Now!




String comparison

 
Reply to this topicStart new topic

String comparison

Emmanuel
28 Dec, 2006 - 10:19 PM
Post #1

New D.I.C Head
*

Joined: 20 Dec, 2006
Posts: 2


My Contributions
HI Dustyd63 i still not able to solve the problem..the codes tat u gave is not working..can u help me on dis??
User is offlineProfile CardPM
+Quote Post

m2s87
RE: String Comparison
29 Dec, 2006 - 02:35 AM
Post #2

D.I.C Regular
Group Icon

Joined: 28 Nov, 2006
Posts: 390



Thanked: 1 times
Dream Kudos: 1225
My Contributions
You would be able to do it in vb 6 (or earlier), code something like:

Put this in form module
CODE

Private Sub Form_Load()

    Dim r As New string_x, a As New string_x

    r.value = "Message-ID: <489958FF1A028542AC33B4CCD58A7DFDB102AB@emmanuel.sp.edu>"
    a.value = "Received: from emmanuel.sp.edu([202.21.157.40]) by student-mail.sp.edu with Microsoft SMTPSVC(6.0.3790.1830);"

    a.value = Mid(a.value, 14, Len(a.value))

    MsgBox (IIf(r.Substring("@", ">") = a.Substring(" ", "("), "Genuine", "Spoofed") & " Email")
End Sub


Make a new class module and name it string_x, and put the following code in it
CODE
Private võ2 As String
Public Property Let value(ByVal vData As String):    võ2 = vData: End Property
Public Property Get value() As String: value = võ2: End Property
Public Property Get Substring(ByVal vData1 As String, ByVal vData2 As String) As String
    Dim i, x
    For i = 1 To Len(võ2)
        x = Mid(võ2, i, 1)
        
        If x = vData2 Then Exit For
        If loenda = True Then Substring = Substring & x
        If x = vData1 Then loenda = True

    Next i
End Property


This example is tested, and works, but i am not 100% curtain it is 100% compatible. Hope it helps. biggrin.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 07:47PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month