WP7 上傳檔案

2021-06-05 23:05:20 字數 1304 閱讀 6937

上傳檔案用webclient類和httpwebrequest類都可以,但用webclient無法獲取伺服器端的返回內容,至少我沒發現有什麼方法  httpwebrequest類**:

///

/// 傳送內容

///

private byte bsendingfile = null;

using (isolatedstoragefilestream sendingzipstream2 = new isolatedstoragefilestream(strzipfoldername + "/" + strzipfilename, filemode.open, isostorage))

catch(exception ex)

}///

/// 返回用於將資料寫入stream,寫入資料,並傳送

///

///

private void requeststreamcallback(iasyncresult result)

///

/// 獲取最終的返回結果

///

///

private void responsecallback(iasyncresult result)}}

catch (exception ex)}

多上傳的stream進行組裝

// 返回用於將資料寫入某 uri 資源的 stream

stream requeststream = request.endgetrequeststream(result);

// 構造傳送資料

stringbuilder sb = new stringbuilder();

// 檔案域的資料

string postheader = sb.tostring();

byte postheaderbytes = encoding.utf8.getbytes(postheader);

requeststream.write(postheaderbytes, 0, postheaderbytes.length);

requeststream.write(bsendingfile, 0, bsendingfile.length);

byte b3 = system.text.encoding.utf8.getbytes("\r\n--" + boundary + "--");

requeststream.write(b3, 0, b3.length);

requeststream.flush();

requeststream.close();

WP7 開發(五) wp7控制項開發(二)

1 passwordbox 用於輸入自定義遮罩字元的密碼框控制項,屬性passwordchar用來顯示輸入的密碼替換符號 2 textbox 可以讓軟鍵盤產生不同的鍵面效果 inputscope屬性可通過 獲取屬性列表 typeof inputscopenamevalue getfields bin...

wp7遊戲 wp7 競賽類遊戲 集合貼

wp7遊戲 極品飛車14 熱力追蹤 1.2 wp7遊戲 驚險火箭車 1.0 wp7遊戲 雷霆快艇 1.4 遊戲 極品飛車之臥底 v1.0.0.0 wp7遊戲 速度與激情 1.1.0.0 wp7遊戲 野蠻狂飆 1.0 wp7遊戲 全民卡踏車 1.0 wp7遊戲 瘋狂賽車 1.0.0.0 wp7遊戲 極...

WP7 主題樣式

wp7提供了系統的主題樣式,應用程式可以根據使用者的設定來讓應用程式與系統程式的主題一致,讓使用者體驗更加良好,微軟內建了許多系統資源,應用程式可以通過呼叫這些系統資源直接應用系統的一些資源 用法如下 給textblock設定系統預設字型樣式 textblock height 45 horizont...