当前位置: 代码迷 >> Windows Mobile >> wp8 dll 中怎么使用 xmlhttprequest2
  详细解决方案

wp8 dll 中怎么使用 xmlhttprequest2

热度:88   发布时间:2016-04-25 07:23:01.0
wp8 dll 中如何使用 xmlhttprequest2 ?
正在把win store dll 的代码转到win phone dll中,
其中Windows::Storage::Streams::InMemoryRandomAccessStream类不支持wp8,
应该如何改写,才能获取一个stream ,然后能通过xmlhttprequest2.send发给出去?

windows store中的代码:

ComPtr<IStream> sequentStream;
auto randomAccessStream = ref new Windows::Storage::Streams::InMemoryRandomAccessStream();
CreateStreamOverRandomAccessStream(randomAccessStream, IID_PPV_ARGS(&sequentStream));
...
sequentStream->Write(aDst, strlen(aDst), NULL);
ret = m_xhr->Send(sequentStream.Get(), strlen(aDst)+1);


在wp8下如何替换掉InMemoryRandomAccessStream和CreateStreamOverRandomAccessStream并能够得到一个sequentStream ?
Windows?Phone?8 XMLHttpRequest

------解决方案--------------------
有一些扩展方法 以as 开头的。你看看
可以从winrt转换到.net