本文介绍了"不支持给定路径的格式&QUOT。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我给了code以下行的Web服务:

I gave following line of code on web service:

string str_uploadpath = Server.MapPath("/UploadBucket/Raw/");
FileStream objfilestream = new FileStream(str_uploadpath +
                fileName, FileMode.Create, FileAccess.ReadWrite);

能有一个人帮我这个错误消息的code 2线解决问题。

Can some one help me resolve issue with this error message from line 2 of the code.

不支持给定路径的格式。

权限设置为完全访问每个人,这是实际路径文件夹中的文件夹中。突破点给我的 str_uploadpath C:\\ webprojects \\ web服务\\ UploadBucket \\ \\原料

Permission on the folder set to full access to everyone and it is actual path to the folder.break point gave me value of str_uploadpath as C:\\webprojects\\webservices\\UploadBucket\\Raw\\.

什么是错的这个字符串我看不到。

What is wrong with this string I can not see.

推荐答案

而不是使用 str_uploadpath +文件名,请尝试使用的来代替:

Rather than using str_uploadpath + fileName, try using System.IO.Path.Combine instead:

Path.Combine(str_uploadpath, fileName);

返回一个字符串。

which returns a string.

这篇关于"不支持给定路径的格式&QUOT。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 08:48