Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Kod główny
- Uri url1 = new Uri("https://api.roblox.com/users/" + Id + "/onlinestatus/");
- Thread.Sleep(3500);
- string placeIdS = (string)WebRequestGET(url1)["PlaceId"];
- long placeId = long.Parse(placeIdS);
- //Metoda WebRequestGET
- private static dynamic WebRequestGET(Uri url)
- {
- try
- {
- var request = WebRequest.Create(url);
- request.Method = "GET";
- request.Timeout = 10000;
- WebResponse webResponse = request.GetResponse();
- var webStream = webResponse.GetResponseStream();
- var reader = new StreamReader(webStream);
- var data = reader.ReadToEnd();
- dynamic jsonData = JObject.Parse(data);
- return jsonData;
- }catch(Exception e)
- {
- var window = GetConsoleWindow();
- ShowWindow(window, 1);
- Console.WriteLine($"Error occured while fetching data, if error will occur again please create issue on github{Environment.NewLine}{e.Message}");
- Console.ReadKey();
- Application.Exit();
- return null;
- }
- }
Add Comment
Please, Sign In to add comment