silverlight 删除文件
写WebMethod方法再调用
View Code
#region 删除文件(图片) [WebMethod] public string FileDelete(string fileName) { try { File.Delete(System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "/ClientBin/" + fileName); return "ok"; } catch (Exception e) { return e.ToString(); } } #endregion
调用语句
webClient.FileDeleteAsync(filename);