Forum C# Player.IO.Web doesn't work

Player.IO.Web doesn't work

Postby YegorShatov » May 23rd, 2016, 5:22 pm

I'm trying to connect to 3rd party web-server), while they own Web-interface for HTTP doesn't work (for me)

Web.Get("url", delegate (HttpResponse rspnd) { });

This line of code giving me an CS0120 VS error (An object reference is required for the nonstatic field, method, or property 'member')

The thing is - its abstract class, so i can't create instance of an object and can't access it directly, because it is non-static.

Is anyone else expirience the same problem? could it be problem only with some of my pc?
YegorShatov
 
Posts: 2
Joined: January 23rd, 2016, 8:42 am

Re: Player.IO.Web doesn't work

Postby robscherer123 » May 24th, 2016, 2:08 pm

Are you getting this error when you try to compile or at runtime?
robscherer123
Paid Member
 
Posts: 313
Joined: December 12th, 2012, 8:46 pm

Re: Player.IO.Web doesn't work

Postby YegorShatov » May 24th, 2016, 3:16 pm

when i'm trying to compile, obviously
YegorShatov
 
Posts: 2
Joined: January 23rd, 2016, 8:42 am

Re: Player.IO.Web doesn't work

Postby ChristianD » May 29th, 2016, 12:31 am

You have to use it through the PlayerIO object, like the documentation example:

https://playerio.com/documentation/refe ... ibrary.web

Code: Select all
public override void GameStarted() {
    var url = "http://www.mywebpage.com";
    PlayerIO.Web.Get(url, delegate(HttpResponse response) {
        Console.WriteLine(response.Text);
    });
}
Christian
ChristianD
.IO
 
Posts: 63
Joined: May 13th, 2016, 4:44 am


Return to C#