在C#.net中在服务器端获取并验证NSData(图像的)
我通过点击提交按钮向服务器发送post请求,并发送图像数据和aspx表单本身。这是我的密码在C#.net中在服务器端获取并验证NSData(图像的),c#,.net,iphone,objective-c,C#,.net,Iphone,Objective C,我通过点击提交按钮向服务器发送post请求,并发送图像数据和aspx表单本身。这是我的密码 NSURL *postURL = [NSURL URLWithString:urlName]; //..... this is my url name..... NSMutableURLRequest *postRequest = [NSMutableURLRequest requestWithURL:postURL]; [postRequest setHTTPMethod:@"POST"];
NSURL *postURL = [NSURL URLWithString:urlName]; //..... this is my url name.....
NSMutableURLRequest *postRequest = [NSMutableURLRequest requestWithURL:postURL];
[postRequest setHTTPMethod:@"POST"];
NSString *stringBoundary = @"0xKhTmLbOuNdArY---This_Is_ThE_BoUnDaRyy---pqo";
NSString *headerBoundary = [NSString stringWithFormat:@"multipart/form-data;boundary=%@",stringBoundary];
[postRequest addValue:headerBoundary forHTTPHeaderField:@"Content-Type"];
NSMutableData *postBody = [NSMutableData data];
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"Content-Disposition: form-data; name=\"media\"; filename=\"myemailcheck_kiransalke@yahoo.com.png\"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"Content-Type: image/png\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"Content-Transfer-Encoding: binary\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:imgdata];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithFormat:@"--%@--\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postRequest setHTTPBody:postBody];
NSData *responseData = [NSURLConnection sendSynchronousRequest:postRequest returningResponse:&response error:&err];
我的问题是,如何在服务器端获取和解码图像数据。我正在使用“C#Net”。所以,请用.net语言给我解答
请帮我解决这个问题