【问题标题】:path,file name, or both are too long. name must be less than 260 characters,directory name must be less than 248 characters路径、文件名或两者都太长。名称必须少于 260 个字符,目录名称必须少于 248 个字符
【发布时间】:2013-01-22 09:10:40
【问题描述】:

错误:System.Reflection.TargetInvocationException:调用的目标已引发异常。 ---> System.Net.WebException:WebClient 请求期间发生异常。 ---> System.IO.PathTooLongException: 指定的路径、文件名或两者都太长。完全限定文件名必须少于 260 个字符,目录名必须少于 248 个字符。

我在 ;

中使用此代码
public void Main()
{
    System.Net.WebClient myWebClient = new System.Net.WebClient();
    myWebClient.DownloadFile(Dts.Variables[0].Value.ToString(),
                             Dts.Variable[1].Value.ToString());
    Dts.TaskResult = (int)ScriptResults.Success;
}

地点:

Dts.Variables[0].Value.ToString() == https://secure.f-prot.com/keyportal/cgi-bin/keyportalorder.pl?u=l&p=ooetcetcd&product_id=1&number_of_u=3&type=1&length=a&partner_id=2932&order_ref=4&account_reference_name=audney&account_reference_value=margaretculclagers%sbcglobal.net

Dts.Variables[1].Value.ToString() == C:\Audiney_API_File\keyportal_accountinfo.pl.xml

请帮助我。

【问题讨论】:

标签: asp.net ssis c#-3.0


【解决方案1】:

我的错误已解决..

根本原因:我使用了错误的变量..

即;而不是这样写(URL,LocalFolder)

我写过 (LocalFolder,URL)。 :)..

【讨论】:

    猜你喜欢
    • 2011-02-01
    • 2015-04-03
    • 2012-04-30
    • 2012-07-11
    • 2016-02-03
    • 2016-02-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多