-
Notifications
You must be signed in to change notification settings - Fork 0
/
API.cs
39 lines (30 loc) · 1.06 KB
/
API.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using System.Net;
namespace Connector
{
class API
{
public string info { get; set; }
System.Net.WebClient WebC = new System.Net.WebClient();
public int _ProductID { get; set; }
public string _ProductName { get; set; }
public double _Price { get; set; }
string APILink = "http://suiteinn.net/ApiReceiving.aspx?username=suiteinnhotel&password=01096812667";
string Param = "&ProductID=_ProductID&ProductName=_ProductName&Price=_Price";
public void SendData()
{
Param = Param.Replace("_ProductID", _ProductID.ToString());
Param = Param.Replace("_ProductName", _ProductName);
Param = Param.Replace("_Price", _Price.ToString());
APILink += Param;
//
WebC.DownloadString(APILink);
// var str = System.Text.Encoding.Default.GetString(WebC.DownloadData(APILink));
}
}
}