The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
Code:
If InStr(Request.ServerVariables("REMOTE_ADDR"),"41.207") > 0 ThenIs there a way I can make sure this only matches at the beginning of the string?
For example...
Match > 41.207.256.325
Do not match > 256.41.207.325
Thanks!<
آخرین ویرایش توسط
نوشته شده در
If there is a match, the matching position will be returned, so you just need to check the value. If 1, it's the beginning of the string, if greater than 1 you know it wasn't matched at the beginning of the string.<
نوشته شده در
Ahhhhh... So I would want...
Never knew that. Thanks!
<
Code:
If InStr(Request.ServerVariables("REMOTE_ADDR"),"41.207") = 1 Then
Never knew that. Thanks!
نوشته شده در
Originally posted by bobby131313Yeppers... you're welcome
Ahhhhh... So I would want...Code:If InStr(Request.ServerVariables("REMOTE_ADDR"),"41.207") = 1 Then
Never knew that. Thanks!![]()
نوشته شده در
If InStr(Request.ServerVariables("REMOTE_ADDR"),"41.207") = 1 Then
does the same thing as
if left(Request.ServerVariables("REMOTE_ADDR",6))="41.207" then<
does the same thing as
if left(Request.ServerVariables("REMOTE_ADDR",6))="41.207" then<
آخرین ویرایش توسط
نوشته شده در
Good to know....
So...
and
Will do the same thing....
Thanks! <
So...
Code:
If InStr(Request.ServerVariables("REMOTE_ADDR"),"41.207") = 1 Then
Go the hell away!
end ifCode:
if left(Request.ServerVariables("REMOTE_ADDR",6))="41.207" then
Go the hell away!
end ifThanks! <
نوشته شده در
Using a fixed length extract will fail if your next problem visitor is from an IP like "241.207" Now it's 7 characters long. I'd use rui's solution.
<
<
======
Doug G
======
Computer history and help at www.dougscode.com
Doug G
======
Computer history and help at www.dougscode.com
نوشته شده در
Originally posted by Doug G
Using a fixed length extract will fail if your next problem visitor is from an IP like "241.207" Now it's 7 characters long. I'd use rui's solution.
However, since he specified he wanted "the beginning of the string", then he would not want a match of "241.207".<
Email Member
Message Member
Post Moderation
بارگزاری فایل
If you're having problems uploading, try choosing a smaller image.
پیشنمایش مطلب
Send Topic
Loading...