Click here to Skip to main content
15,918,742 members
Home / Discussions / C#
   

C#

 
GeneralRe: Editing/Creating Group Policies in XP through C# Pin
Schleichermann7-Apr-05 9:53
Schleichermann7-Apr-05 9:53 
GeneralRe: Editing/Creating Group Policies in XP through C# Pin
Dave Kreskowiak7-Apr-05 12:17
mveDave Kreskowiak7-Apr-05 12:17 
GeneralGeneral question about file updating Pin
Member 18639967-Apr-05 7:00
Member 18639967-Apr-05 7:00 
GeneralRe: General question about file updating Pin
Colin Angus Mackay7-Apr-05 12:45
Colin Angus Mackay7-Apr-05 12:45 
GeneralWrong Decryption Output Pin
thanhnhahuynh7-Apr-05 6:59
thanhnhahuynh7-Apr-05 6:59 
GeneralRe: Wrong Decryption Output Pin
mav.northwind7-Apr-05 20:15
mav.northwind7-Apr-05 20:15 
GeneralHtml stripping regex Pin
OmegaSupreme7-Apr-05 5:59
OmegaSupreme7-Apr-05 5:59 
GeneralAnalyzing javascript functions Pin
ShajeeDotNet7-Apr-05 5:03
ShajeeDotNet7-Apr-05 5:03 
Hi,

I want to convert javascript functions Relative URL to absolute URL.

I have all the javascript urls extracted from a web page this being done from the HTML DOM of web page and the page is being browsed in webbrowser control in my c# project.

I want to get the absolute url of a javascript function. Presently i using the simulating the onclick event of Browser through MSHTML and capturing the url in beforenavigate event but that ends up in a chaos as it sends reuqest for navigation and takes up time. This scenario is quite cumbersome in cases
where there are a no. of javascript functions and for each a request is being sent.

One possible way is to stop the browsing once i have the url, however that doesnt seems to be a good way to solve the problem.

some examples
javascript:OpenPage('http://google.com');

Absolute Path:- http://google.com

javascript:LinkToPage2('/sports','/games.htm')
This being on the domain of yahoo.com so

Absolute Path:- http://www.yahoo.com/sports/games.htm

--
some code
---
for(int j = 0; j < anchors.length; ++ j)
{
link = (mshtml.IHTMLAnchorElement)anchors.item(j, null);
if (link.href.ToLower().StartsWith("javascript:"))
{
ele = (mshtml.IHTMLElement)link;
if (cnt == count)
{
currentEle = ele;
currentDoc = doc;
found = true;
break;
}
---
more code
---
currentEle.Click()
}


Now capturing the url in before navigate event

private void BeforeNav(object sender, NavigateEventArgs arg)
{
try
{
string Url = arg.Url
----
----

Any suggestions!


the woods are lovely dark and deep.
but i have promises to keep.
there are miles to go before i sleep...
there are miles to go before i sleep...
GeneralUSB ejection Pin
Pyro Joe7-Apr-05 4:51
Pyro Joe7-Apr-05 4:51 
GeneralRe: USB ejection Pin
Dave Kreskowiak7-Apr-05 5:42
mveDave Kreskowiak7-Apr-05 5:42 
GeneralRe: USB ejection Pin
Joel Lucsy8-Apr-05 15:29
Joel Lucsy8-Apr-05 15:29 
GeneralReading data from a .rar formatted file Pin
AfzalHassen7-Apr-05 4:29
AfzalHassen7-Apr-05 4:29 
GeneralRe: Reading data from a .rar formatted file Pin
techieboi7-Apr-05 4:48
techieboi7-Apr-05 4:48 
GeneralRe: Reading data from a .rar formatted file Pin
AfzalHassen7-Apr-05 20:14
AfzalHassen7-Apr-05 20:14 
Generaldeactivate the possibility to connect a usb-device Pin
mcyrrer7-Apr-05 4:12
mcyrrer7-Apr-05 4:12 
GeneralRe: deactivate the possibility to connect a usb-device Pin
Dave Kreskowiak7-Apr-05 4:58
mveDave Kreskowiak7-Apr-05 4:58 
GeneralShell parameters - get them Pin
Seraphin7-Apr-05 3:48
Seraphin7-Apr-05 3:48 
GeneralRe: Shell parameters - get them Pin
hooray7-Apr-05 4:06
hooray7-Apr-05 4:06 
Generalable in sqlInserting into SQL server Pin
cmitty7-Apr-05 3:46
cmitty7-Apr-05 3:46 
GeneralCreating objects at Runtime Pin
NeoPolaris7-Apr-05 2:54
NeoPolaris7-Apr-05 2:54 
GeneralRe: Creating objects at Runtime Pin
Ryan Roberts7-Apr-05 3:41
Ryan Roberts7-Apr-05 3:41 
GeneralRe: Creating objects at Runtime Pin
mav.northwind7-Apr-05 8:40
mav.northwind7-Apr-05 8:40 
GeneralRe: Creating objects at Runtime Pin
Ashok Dhamija7-Apr-05 3:42
Ashok Dhamija7-Apr-05 3:42 
GeneralRe: Creating objects at Runtime Pin
J4amieC7-Apr-05 4:26
J4amieC7-Apr-05 4:26 
GeneralRe: Creating objects at Runtime Pin
Dave Kreskowiak7-Apr-05 4:55
mveDave Kreskowiak7-Apr-05 4:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.