示例#1
0
        public void SendNet64Data(string name, byte[] data, string location)
        {
            if (!(data is object))
            {
                return;
            }

            var postStarsClient = new ExtendedWebClient();

            JObject json = new JObject
            {
                ["player"]   = name,
                ["state"]    = Convert.ToBase64String(data),
                ["location"] = location
            };

            string sendString = json.ToString();

            NameValueCollection values = new NameValueCollection
            {
                { "net", sendString }
            };

            postStarsClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
            postStarsClient.Headers.Add(HttpRequestHeader.Cookie, token.ToString());
            postStarsClient.UploadValuesAsync(new Uri(url + post), "POST", values);
        }
示例#2
0
        public void SendData(byte[] data)
        {
            var postStarsClient = new ExtendedWebClient();

            string sendString = Convert.ToBase64String(data);

            NameValueCollection values = new NameValueCollection
            {
                { category, sendString }
            };

            postStarsClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
            postStarsClient.Headers.Add(HttpRequestHeader.Cookie, token.ToString());
            postStarsClient.UploadValuesAsync(new Uri(url + post), "POST", values);
        }