0

Snoopy is a PHP class that provides the functionality of a web-browser. Is there anything that does the same in C#? I'm having lots of trouble with handling cookies, etc.

James B
  • 8,183
  • 4
  • 33
  • 40
Dmitriy
  • 552
  • 1
  • 6
  • 20
  • Don't really understand what you want from us... Could you rewrite? – Oskar Kjellin Apr 21 '10 at 21:25
  • I'm not terribly sure what you're asking here but if you need to interface with some PHP code from C#, then Phalanger might be an option: http://www.codeplex.com/wikipage?ProjectName=Phalanger – Joey Apr 21 '10 at 21:25
  • Please re-format as a proper question, and provide some more information both on Snoopy (as background), and on what you'd like to achieve in C#. – James B Apr 21 '10 at 21:26
  • The post makes absolutely no sense... – Aren Apr 21 '10 at 21:26
  • 3
    @Oskar, SLaks & Johannes: He wants a similar library to Snoopy (which emulates web browsing in PHP) in C#, as far as I can tell. – James B Apr 21 '10 at 21:26
  • 1
    Wow. I think he wants a C# version of snoopy. That's my best guess. Searching c# snoopy in google yields some funny results. – webbiedave Apr 21 '10 at 21:30
  • Unfortunately this is not quite what ш want. Now I try to login to forum vbulletin and similar others, but I can not. Using HttpWebRequest - difficult to work with Cookies. Maybe you tell my how do I log in the forum and other? – Dmitriy Apr 22 '10 at 10:57

2 Answers2

1

What about Snoopy do you need? There is a WebBrowser Class in C#

You don't specify what about cookies are giving you problems, so this is the best I can do for now for that part:

Community
  • 1
  • 1
Dinah
  • 52,922
  • 30
  • 133
  • 149
0

The simplest thing would be HttpWebRequest - you create one like this:

HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://www.example.com/");
//set request properties

//get response
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

And you can then set headers, cookies etc. You could write your own wrapper class to give it an interface similar to Snoopy.

Lee
  • 142,018
  • 20
  • 234
  • 287