Find Jobs
Hire Freelancers

Convert C# class to iPhone Objective C class

$5-10 USD

进行中
已发布超过 12 年前

$5-10 USD

货到付款
Convert a C# class (see details) to an iPhone objective C class. Please stay as close to this C# class as possible, including using Dictionary. Here is the C# usage of the class. I need an iPhone/Objective C class (NSObject class) which can be used similar to this: C# usage: CommDB db = new CommDB(); [login to view URL] ="someCommand"; [login to view URL]("key","value"); [login to view URL]("key2", "value2"); string response = [login to view URL](); ## Deliverables See the attached file for a better view of the C# class. class CommDB //database communication object { //public properties public string cmd { get; set; } public Dictionary d { get; set; } //this could be added as a variable for play on a different server private const string url = "[login to view URL]"; public CommDB() { d = new Dictionary(); } public string SendPost() { string post = "cmd=" + cmd; //add all name value pairs to post string foreach (KeyValuePair dictionary in d) { post += "&" + [login to view URL] + "=" + [login to view URL]; } string response = null; try { //Our postvars byte[] buffer = [login to view URL](post); //debug //[login to view URL]("POST: {0}", post); //Initialisation, we use localhost, change if appliable HttpWebRequest WebReq = (HttpWebRequest)[login to view URL](url); //Our method is post, otherwise the buffer (postvars) would be useless [login to view URL] = "POST"; //We use form contentType, for the postvars. [login to view URL] = "application/x-www-form-urlencoded"; //The length of the buffer (postvars) is used as contentlength. [login to view URL] = [login to view URL]; //We open a stream for writing the postvars Stream PostData = [login to view URL](); //Now we write, and afterwards, we close. Closing is always important! [login to view URL](buffer, 0, [login to view URL]); [login to view URL](); //Get the response handle, we have no true response yet! HttpWebResponse WebResp = (HttpWebResponse)[login to view URL](); //Let's show some information about the response //[login to view URL]([login to view URL]); //[login to view URL]([login to view URL]); //Now, we read the response (the string), and output it. Stream Answer = [login to view URL](); StreamReader _Answer = new StreamReader(Answer); response = [login to view URL](); } catch (Exception ex) { [login to view URL]([login to view URL]); } return [login to view URL](); } }
项目 ID: 3722322

关于此项目

2提案
远程项目
活跃12 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
See private message.
$7 USD 在2天之内
5.0 (14条评论)
4.1
4.1
2威客以平均价$7 USD来参与此工作竞价
用户头像
See private message.
$7 USD 在2天之内
4.9 (23条评论)
4.6
4.6

关于客户

UNITED STATES的国旗
United States
5.0
48
会员自3月 15, 2007起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。