Dim Text1 AsString = "Received:"""Dim Text2 AsString = "From:"""
IfString.Compare(Text1, Text2, True) = 1 Then
MsgBox("Genuine Email")
EndIf
IfString.Compare(Text1, Text2, False) = 0 Then
MsgBox("Spoofed Email")
EndIf
If TextBox2.Text = "" Then
MessageBox.Show("You must enter something in the text box")
EndIf
I did this but it is not working...it doesnt comparing..coz if the from and received from is same then its genuine else it is spoofed...
Can you help me on this?
Thanks.
Last edited by tgreer; Nov 21st, 2006 at 2:35 pm. Reason: Added code tags, removed non-code formatting.
For example if both strings are identical is the value equal to 1, like you have put or is it equal to 0.
I think it is equal to 0.
Quote ...
Comparing Strings
The Compare method compares two strings and returns an integer value. The return value of Compare method can be less than zero, greater than zero or equals to zero.
Value Meaning
Less than zero When first string is less than second.
Zero When both strings are equal.
Greater than zero When first string is greater than zero.
Hi Thanx for ure code...but this not the code that im sayin abt....act i dunnoe to compare a string within a string eg:From:"BOB" and Received:"Lisa" have to compare that both from a chunk of email headers from the microsoft outlook..coz im doin a application tool to detect for spoofed email..so i have to compare the 2 field from:"" & received:"" field....if "BOB" and "LISA" r the same den its genuine email else its spoofed....its like compare string within string...i hope u get wad i mean here...thank u very much....it will b a great help if u can help me on dis....
You say you don't know how to compare a string within a string.
You need to google 'searching for substrings within a string'. I know vb.net has a method for this.
Last edited by iamthwee; Nov 23rd, 2006 at 4:33 pm.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.