[LIST=1]
[*]if (Request.ServerVariables["HTTP_REFERER"].IndexOf("google") > 0)
[*] {
[*] string KeyURL = Request.ServerVariables["HTTP_REFERER"]; </SPAN>
[*] int KeyLen = KeyURL.Length; </SPAN>
[*] int kStart = KeyURL.IndexOf("q="); </SPAN>
[*] kStart = kStart + 1;
[*] int KeyRight = KeyLen - kStart; </SPAN>
[*] string Keyword = KeyURL.Substring(0, KeyRight); </SPAN>
[*]
[*] if (Keyword.IndexOf("&") > 0) </SPAN>
[*] {
[*] int kEnd = Keyword.IndexOf("&"); </SPAN>
[*] kEnd = kEnd - 1;
[*] Keyword = Keyword.Substring(Keyword.Length - 1, (Keyword.Length - kEnd));
[*] }
[*] Keyword = Keyword.Replace("+", " "); </SPAN>
[*] Keyword = Keyword.Replace(",", ", "); </SPAN>
[*] Keyword += " "+ Keyword.ToString(); </SPAN>
[*]}
[*]help
[*]
[*]pls error
[/LIST]
**Server Error in '/' Application. **
**Index and length must refer to a location within the string.
Parameter name: length**
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
Source Error:
Line 46: int kEnd = Keyword.IndexOf("&");Line 47: kEnd = kEnd - 1;Line 48: Keyword = Keyword.Substring(Keyword.Length - 1, (Keyword.Length - kEnd));Line 49: }Line 50: Keyword = Keyword.Replace("+", " ");