ipviking在c#上使用它 [英] ipviking use it on c#

查看:87
本文介绍了ipviking在c#上使用它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#中使用ipviking代码.....?

我有API密钥,当我在我的程序中使用这些密钥时它出错(400 Bad Request)



任何人都可以帮助我吗?

我的代码是

How to use ipviking code in c#.....?
I have the API key and when i use these key in my program its through error(400 Bad Request)

Can any one help me?
my code is

WebRequest request = WebRequest.Create("http://beta.ipviking.com/api/&apikey=** REMOVED **&method=ipq&ip=202.104.251.200");
request.Method = "POST";

string postData = "D={\"requests\":[{\"C\":\"Gpf_Auth_Service\", \"M\":\"authenticate\", \"fields\":[[\"name\",\"value\"],[\"Id\",\"\"],[\"username\",\"user@example.com\"],[\"password\",\"ab9ce908\"],[\"rememberMe\",\"Y\"],[\"language\",\"en-US\"],[\"roleType\",\"M\"]]}],  \"C\":\"Gpf_Rpc_Server\", \"M\":\"run\"}";
byte[] byteArray = Encoding.UTF8.GetBytes(postData);

request.ContentType = "application/x-www-form-urlencoded";

request.ContentLength = byteArray.Length;

Stream dataStream = request.GetRequestStream();

dataStream.Write(byteArray, 0, byteArray.Length);

dataStream.Close();

WebResponse response = request.GetResponse();

dataStream = response.GetResponseStream();

StreamReader reader = new StreamReader(dataStream);

string responseFromServer = reader.ReadToEnd();

Console.WriteLine(responseFromServer);

reader.Close();
dataStream.Close();
response.Close();
return View();

推荐答案

你应该说说对创建它的人 - https://ipviking.com [ ^ ] - 他们应该提供技术支持,并且会比我们更了解他们的产品。如果他们不这样做,那就找另一个供应商并要求退款!
You should talk to the people who created it - https://ipviking.com[^] - they should provide technical support and will know more about their product than we will. If they don't, then find another supplier and demand your money back!


这篇关于ipviking在c#上使用它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆