Windows phone 7 如何上传图像wp7服务器端。?
你好,我有一个隔离的存储文件,这个文件是图像,所以我想把这个图像上传到服务器端,以便使用头像,这样我就可以上传我的图像字节[] 我的代码是这样的Windows phone 7 如何上传图像wp7服务器端。?,windows-phone-7,image-uploading,Windows Phone 7,Image Uploading,你好,我有一个隔离的存储文件,这个文件是图像,所以我想把这个图像上传到服务器端,以便使用头像,这样我就可以上传我的图像字节[] 我的代码是这样的 using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) { // Open the file - error handling omitted for brevity
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
{
// Open the file - error handling omitted for brevity
// Note: If the image does not exist in isolated storage the following exception will be generated:
// System.IO.IsolatedStorage.IsolatedStorageException was unhandled
// Message=Operation not permitted on IsolatedStorageFileStream
using (IsolatedStorageFileStream isfs = isf.OpenFile("myImage.jpg", FileMode.Open, FileAccess.Read))
{
// Allocate an array large enough for the entire file
data = new byte[isfs.Length];
// Read the entire file and then close it
isfs.Read(data, 0, data.Length);
isfs.Close();
}
}
// Create memory stream and bitmap
MemoryStream ms = new MemoryStream(data);
BitmapImage bi = new BitmapImage();
// Set bitmap source to memory stream
bi.SetSource(ms);
如何将此字节[]上载到webClient或HttpwebRequest
谢谢 您是否签出了以下链接:。这应该行得通