Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am trying to fetch the current url of opera browser in my c# application using the DdeClient WWW_GetWindowInfo. Tried a lot but with no success.

Here is my code:
C#
DdeClient dde = new DdeClient(browser, "WWW_GetWindowInfo");
                dde.Connect();
                string url = dde.Request("URL", int.MaxValue);
                string[] text = url.Split(new string[] { "\",\"" }, StringSplitOptions.RemoveEmptyEntries);
                dde.Disconnect();
                string url1= text[0].Substring(1);
                StreamWriter sw = new StreamWriter(currentFileName, true);
                Console.Write(url1);
                sw.Write(url1);


Searched a lot and many have mentioned that this works same as firefox. But as soon as i call my function passing GetBrowserURL("opera") as argument, it displays me this error:

The client failed to connect to "opera|WWW_GetWindowInfo".  Make sure the server application is running and that it supports the specified service name and topic name pair.


Please help me get this done. Thanks in advance.
Posted
Updated 16-Apr-17 5:14am
v2

Maybe have a look at this SO post:
Get url from Opera browser[^]

Hope this helps.
 
Share this answer
 
Is there a way i can use UIAutomation to get opera current url. I just used UIAutomation to get the current url of firefox and it worked fine. UIAutomation also works great with Chrome too. But i didnt got any clue as if it works with opera as well.

Please show me how to do it for opera using UIAutomation. Thanks in advance.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900