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.
I need to find any instance of Yandex regardless of case in "AffAgent" which is the user agent. Did some Googling and came up with the following but I don't think it's working.
Does it look like it should or did I google some bum info?
Code:
Dim AffAgent : AffAgent = Request.ServerVariables("HTTP_USER_AGENT")
If InStr(1, AffAgent, "Yandex", VBTextCompare) > 0 Then
Do something
End If
Does it look like it should or did I google some bum info?
آخرین ویرایش توسط
نوشته شده در
It looks like it should... are you sure its not working? I ask only because I spent an hour today troubleshooting "missing" records that were missing because I mis-typed the date range...
As a side note, I tend to use <> 0 instead of > 0 - not that it should matter.
As a side note, I tend to use <> 0 instead of > 0 - not that it should matter.
آخرین ویرایش توسط
نوشته شده در
are you sure its not working?
No, not positive. Just figured I'd check that first. This code is to intercept ignorant bots that follow affiliate links and send them through a non-affiliate link so my stats don't get skewed. One of my sites that usually get about 400 clicks a day to this particular affiliate is now at over 1,100 for today with about 4 hours left.
Guess I'll be going through some log files tomorrow.
Thanks for your help!
نوشته شده در
You can control whether instr does a case-sensitive comparison or not
http://msdn.microsoft.com/en-us/library/wybb344c(VS.85).aspx
http://msdn.microsoft.com/en-us/library/wybb344c(VS.85).aspx
======
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
You can control whether instr does a case-sensitive comparison or not
http://msdn.microsoft.com/en-us/library/wybb344c(VS.85).aspx
EDIT: Hmm, snitz here doesn't seem to like the above URL, textually it's
Code:
http://msdn.microsoft.com/en-us/library/wybb344c(VS.85).aspxEDIT2: Sheesh! Even inside CODE tags the url tries to become a broken link.
======
Doug G
======
Computer history and help at www.dougscode.com
Doug G
======
Computer history and help at www.dougscode.com
آخرین ویرایش توسط
نوشته شده در
Originally posted by Doug GLooks like he already is since he's using vbTextCompare...
You can control whether instr does a case-sensitive comparison or not
نوشته شده در
An alternate approach is to do a forced lower-case comparison like this:
Code:
if inStr(lcase(AffAgent),"yandex") then
آخرین ویرایش توسط
نوشته شده در
Originally posted by CarefreeUsing vbTextCompare makes it a case-insensitive comparison... If you don't have some test data that has known positives and known negatives, it doesn't matter what you try as you will never know if its working.
An alternate approach is to do a forced lower-case comparison like this:Code:if inStr(lcase(AffAgent),"yandex") then
نوشته شده در
Thanks everyone. It appears my code is working. The clicks were due to IE5 downloading for "off-line" viewing. Got that addressed now after trudging through the logs.
Email Member
Message Member
Post Moderation
بارگزاری فایل
If you're having problems uploading, try choosing a smaller image.
پیشنمایش مطلب
Send Topic
Loading...