Lost Password?

Go Back   CodeCall Programming Forum > Software Development > C# Programming

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-12-2007, 04:22 PM
Skel Skel is offline
Learning Programmer
 
Join Date: May 2007
Posts: 30
Credits: 11
Rep Power: 6
Skel is on a distinguished road
Default Stop Redirection.

Well i need a bit of code that stops redirection please. I have a link that is redirected by javascript and i need to stop it redirecting. I talked to someone and they told me to add this:

Code:
private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
        {
            if (e.Url = "http://www.runescape.com")
            {
                e.Cancel = true;
            }
        }
I tried adding it, but it came up with an error. Any help please?

Thanks.

Last edited by Skel; 05-13-2007 at 05:39 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 05-13-2007, 12:16 AM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,237
Last Blog:
Passwords
Credits: 877
Rep Power: 20
John has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud of
Send a message via AIM to John Send a message via MSN to John
Default

What did the error say? Did you replace URLHERE with the proper URL? Is that all the code? From the snippet you posted the method and if statement are not closed.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-13-2007, 05:35 AM
Skel Skel is offline
Learning Programmer
 
Join Date: May 2007
Posts: 30
Credits: 11
Rep Power: 6
Skel is on a distinguished road
Default

Yeh i inserted the code correcttly and repleced the URL here. The bracksets are closed, i just forgot to add them in. It underlines the bit of code with a brown line.

Error:

Quote:
Cannot Implicity Convert Type 'System.Uri' to 'Bool'

Last edited by Skel; 05-13-2007 at 05:38 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-14-2007, 12:30 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 7,330
Last Blog:
Tramp Variables
Credits: 1
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

Your if statement is wrong. You have:

PHP Code:
if (e.Url "http://www.runescape.com"
It should be:

PHP Code:
if (e.Url == "http://www.runescape.com"
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-14-2007, 03:58 PM
Skel Skel is offline
Learning Programmer
 
Join Date: May 2007
Posts: 30
Credits: 11
Rep Power: 6
Skel is on a distinguished road
Default

Thanks, but ive already tried that. I get this error:

Quote:
Operator '==' cannot be applied to operands of type 'System.Uri' and 'string'
Any ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 05-14-2007, 04:23 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 7,330
Last Blog:
Tramp Variables
Credits: 1
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

EDIT: I should have read the initial post again.......
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-14-2007, 04:28 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 7,330
Last Blog:
Tramp Variables
Credits: 1
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

Try this:

Code:
if (e.Url.ToString() == "http://url.here")
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-16-2007, 03:54 PM
Skel Skel is offline
Learning Programmer
 
Join Date: May 2007
Posts: 30
Credits: 11
Rep Power: 6
Skel is on a distinguished road
Default

Thanks for the help again, it compiles but doesnt stop the re-direct =/

Anymore ideas? haha
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 05-16-2007, 04:30 PM
NeedHelp NeedHelp is offline
Programming God
 
Join Date: May 2006
Posts: 527
Credits: 0
Rep Power: 12
NeedHelp is on a distinguished road
Default

See if the IF statement is working by placing a MessageBox with the URL.ToString() value in it. Or put a break inside of it. Perhaps the URL isn't exactly what you think it is. It could be http://www.runescape.com/a/?a=2 and you are looking for an exact match. A better idea would be to search the URL for the runescape.com string.
__________________
I Need Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop Bounce littlefranciscan Marketing 5 02-22-2007 06:53 PM
URL redirection Kaabi Search Engine Optimization 1 07-06-2006 04:42 PM
PHP Redirection dirkfirst PHP Forum 5 07-05-2006 09:44 PM
The ultimate xHTML / DHTML / HTML 301 redirection thread! Dan HTML Programming 5 07-04-2006 05:57 PM
HTML Forwarding / Redirection RobSoftware HTML Programming 8 07-04-2006 01:33 PM


All times are GMT -5. The time now is 02:37 AM.

Contest Stats

Xav ........ 1322.18
MeTh0Dz|Reb0rn ........ 1053.7
morefood2001 ........ 879.43
John ........ 877.37
marwex89 ........ 869.98
WingedPanther ........ 830.24
Brandon W ........ 735.07
chili5 ........ 309.39
Steve.L ........ 239.84
dcs ........ 216.02

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 82%

Ads