用silverlight上传图片创建文件夹的问题
我在页面里嵌入了个silverlight(里面有个图片按钮),点这个按钮后弹出选择本地文件的对话框,然后上传到ClientBin文件夹下的A文件夹,但是我想在上传时自动在A文件夹下创建01文件夹,然后把文件放到那个文件夹下,该怎么实现啊??
[WebMethod] public int UploadFile(byte[] FileByte,string fileBox,string fileName, string FileExtention) { string path="~/ClientBin/A/"; string filePath = Server.MapPath(path +fileBox); if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath);//执行到这就说[color=#FF0000]远程服务器返回了错误:NotFound[/color] } string file = filePath + "\\" + fileName + FileExtention; FileStream stream = new FileStream(file, FileMode.CreateNew); stream.Write(FileByte, 0, FileByte.Length); stream.Close(); return FileByte.Length; } } string file = filePath + "\\" + fileName + FileExtention; FileStream stream = new FileStream(file, FileMode.CreateNew); stream.Write(FileByte, 0, FileByte.Length); stream.Close(); return FileByte.Length; }