Hack Forums
[.NET] Writing to default browser - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Writing to default browser (/showthread.php?tid=5191550)



Writing to default browser - Matriculate - Mar 3, 2016

How would I go about writing a string to a target in the default browser e.g. Firefox or chrome, I don't want to use the webbrowser in vb, I've looked all over and tried a few things but all with no success.
The main objective is to log into a webpage through the default browser.

Thanks 🤝


* - Cecilia - Mar 3, 2016

1. Don't, unless you want a nightmare.
2. You can use different 'browser' packs, check out Awesomium or Gecko.

The second option is more viable, but you might be more limited in it, than in the standard web browser control.


* - Ninja - Mar 4, 2016

You can use webrequests or webclients to login to a web page.


* - Cecilia - Mar 4, 2016

(Mar 4, 2016 12:05 PM)Tyranitar Wrote:  You can use webrequests or webclients to login to a web page.

Exactly, way more efficient.


* - Ninja - Mar 4, 2016

(Mar 4, 2016 05:08 PM)LaPanthere Wrote:  Exactly, way more efficient.

Yee.
And on top of that, I forgot to mention, make sure you handle sessions well. I believe the webclient doesn't handle cookies on it's own so I recommend webrequests. MSDN has documentation and examples for webrequests (and also webclients of course).


* - Cecilia - Mar 4, 2016

(Mar 4, 2016 05:29 PM)Tyranitar Wrote:  Yee.
And on top of that, I forgot to mention, make sure you handle sessions well. I believe the webclient doesn't handle cookies on it's own so I recommend webrequests. MSDN has documentation and examples for webrequests (and also webclients of course).

Please, don't make a class for 'web requests' because you 'need cookie support'.

Extend webclient, its awesome.


* - Ninja - Mar 5, 2016

(Mar 4, 2016 05:32 PM)LaPanthere Wrote:  Please, don't make a class for 'web requests' because you 'need cookie support'.

Extend webclient, its awesome.

You and me both have very different definitions of awesome then. Webrequest already has support for cookies so why extend webclient then. Write a simple class to send webrequests and automatically write postdata and set the post headers, automatically read responses to a string, and optionally a reference parameter to a cookie container object, then you can send webrequests to whatever site you want with 2-3 lines of code.