Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 从FLASH检索POST数据到ASP.Net_C#_Asp.net_Flash_Actionscript_Post - Fatal编程技术网

C# 从FLASH检索POST数据到ASP.Net

C# 从FLASH检索POST数据到ASP.Net,c#,asp.net,flash,actionscript,post,C#,Asp.net,Flash,Actionscript,Post,以下是我的AS3代码: var jpgEncoder:JPGEncoder = new JPGEncoder(100); var jpgStream:ByteArray = jpgEncoder.encode(bitmapData); var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream"); var jpgURLRequest:URLRequest = new U

以下是我的AS3代码:

var jpgEncoder:JPGEncoder = new JPGEncoder(100);
var jpgStream:ByteArray = jpgEncoder.encode(bitmapData);
var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
var jpgURLRequest:URLRequest = new URLRequest("/patients/webcam.aspx");
jpgURLRequest.requestHeaders.push(header);
jpgURLRequest.method = URLRequestMethod.POST;
jpgURLRequest.data = jpgStream;
navigateToURL(jpgURLRequest, "_self");
这是我的ASP.Net代码

try
            {
                string pt = Path.Combine(PathFolder, "test.jpg");
                HttpFileCollection fileCol = Request.Files;
                Response.Write(fileCol.Count.ToString());
                foreach (HttpPostedFile hpf in fileCol)
                {
                    hpf.SaveAs(pt);
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }

我遇到了一个奇怪的错误,HttpFox提到:NS\u error\u NET\u RESET

如果需要,应该将contentType替换为多部分/表单数据 使用c请求.Files属性


此外,它还需要对flash代码进行一些更改,因为数据应该以MIME多部分格式进行编码。

hello!它是多部分/表单数据内容类型吗?我仍然无法接收数据,尽管HttpFox给了我内容长度,但我的c代码没有得到正确的值。它只是说0。我认为您需要以某种方式对数据进行编码,您不能直接发送二进制数据。由于编码不容易,我建议您研究第三方类,以便像MultiparterLoader一样进行编码:可能重复