當前位置:編程學習大全網 - 網站源碼 - 在ASP.NET開發微信公眾平臺如何上傳多媒體?

在ASP.NET開發微信公眾平臺如何上傳多媒體?

string file path = file upload 1。文件名;//獲取文件的完整路徑,包括文件名,如:c:\ documents and settings \ administrator \ my documents \ my pictures \ 20022775 _ m.jpg。

//string file path = file upload 1。文件名;//獲取上傳的文件名20022775_m.jpg

字符串filename = filepath。子字符串(文件路徑。LastIndexOf(" \ \ "+1);//20022775_m.jpg

字符串serverpath = Server。MapPath(" ~/images/")+filename;//獲取文件在服務器上的保存位置c:\ inetpub \ wwwroot \ website 1 \ images \ 20022775 _ m.jpg。

FileUpload1。posted file . save as(server path);//將上傳的文件另存為。

string strsj = " curl-F media = @ "+server path;

string sc = " curl-form upload = @ "+server path+"-form press = OK["+strurl+"]";

string str JSON = post webrequest(sc,"",編碼。UTF8);

這個。上傳信息。Text = strJson

我就是這麽寫的。妳可以改變它。

  • 上一篇:gtx1050ti能玩什麽遊戲
  • 下一篇:原始傳奇戰旗怎麽升級
  • copyright 2024編程學習大全網