C# 在Silverlight应用程序中使用相对路径访问客户端Bin中的文件的正确方法

C# 在Silverlight应用程序中使用相对路径访问客户端Bin中的文件的正确方法,c#,.net,silverlight-5.0,relative-path,bin,C#,.net,Silverlight 5.0,Relative Path,Bin,我有一个从silverlight应用程序的客户端调用的WCF服务,我向它传递一个字符串文件名参数和一个包含xml的字符串参数。在服务方法中,我构造了一个包含xml字符串的XDocument实例,然后将其保存到服务器上ClientBin文件夹中的一个文件中。我一直在使用绝对路径,现在正试图切换到相对路径,但不确定如何正确执行。我的代码如下所示: public void WriteXmlToServer(string filename,string xmlString) { //xml do

我有一个从silverlight应用程序的客户端调用的WCF服务,我向它传递一个字符串文件名参数和一个包含xml的字符串参数。在服务方法中,我构造了一个包含xml字符串的XDocument实例,然后将其保存到服务器上ClientBin文件夹中的一个文件中。我一直在使用绝对路径,现在正试图切换到相对路径,但不确定如何正确执行。我的代码如下所示:

public void WriteXmlToServer(string filename,string xmlString)
{
    //xml document to hold the information for the group that is registered
    XDocument xDoc = new XDocument(XDocument.Parse(xmlString.ToString())); 

    XDocument DataInFile = new XDocument();

    try
    {
        xDoc.Save(Path.Combine("..\\ClientBin\\", filename));
        //the complete absolute path to the .xml file ->C:\Users\Me\Documents\Visual Studio 11\Projects\SL_xMonitor_Frontend_RefactorV1_Backup82212\SL_xMonitor_Frontend_RefactorV1.sln       
    }
    catch (FileNotFoundException e)
    {     
        Console.WriteLine(e.InnerException.ToString());
    }
}
我当前收到此异常消息:

System.IO.DirectoryNotFoundException was unhandled by user code
  HResult=-2147024893
  Message=Could not find a part of the path 'C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\ClientBin\ServerGroups.xml'.

有人能告诉我在Silverlight应用程序中使用客户端bin中文件的相对路径的正确方法吗?

尝试使用单个
而不是
作为
意味着在进入所需目录之前备份一个目录级别,其中as
表示从当前目录开始,然后下降到所需目录。

是否要从客户端在服务器上保存某些内容?