简体   繁体   English

如何使用c#从LiveLink下载文件?

[英]How do I download a file from LiveLink using c#?

I am writing ac# agent to pull data out of Excel workbooks stored in Livelink but I am unable to download the files. 我正在编写ac#代理以将数据从Livelink存储的Excel工作簿中提取出来,但无法下载文件。

webClient = new WebClient();
webClient.Credentials = CredentialCache.DefaultCredentials;
webClient.DownloadFile(strFileLocation, TEMP_FILE_LOC);

This is the code I am using to save the file. 这是我用来保存文件的代码。 strFileLocation is a link generated using the make link utility in Livelink and it is a http link strFileLocation是使用Livelink中的make link实用工具生成的链接,并且是http链接

Here is the code 这是代码

( http://LivelinkServer.com/Livelink/livelink.exe?func=ll.GetTZ&NextURL=%2FLivelink%2Flivelink%2Eexe%3Ffunc%3Dll%26objId%3D128027626%26objAction%3Ddownload%26viewType%3D1 ) http://LivelinkServer.com/Livelink/livelink.exe?func=ll.GetTZ&NextURL=%2FLivelink%2Flivelink%2Eexe%3Ffunc%3Dll%26objId%3D128027626%26objAction%3Ddownload%26viewType%3D1

I get an excel document that has a progress bar that says "Please wait a moment while Livelink is loading..." this looks, to me, like the page that redirects the request in order to get the actual file. 我得到了一个Excel文档,该文档的进度栏显示"Please wait a moment while Livelink is loading..."在我看来,就像重定向请求以获取实际文件的页面一样。

I appears to use a double hop in order to direct you to the file on the Livelink server via the URL it gives you, but I do not know what webservice it calls, examining the response headers gives no clues. 我似乎使用了两次跳转,以便通过它提供给您的URL将您定向到Livelink服务器上的文件,但是我不知道它调用了什么Web服务,检查响应标头没有任何提示。

Does anyone know how to correctly access a file on a Livelink sever? 有人知道如何正确访问Livelink服务器上的文件吗?

Any help would be greatly appreciated, thank you. 任何帮助将不胜感激,谢谢。

You have to call the Web Service function (SOAP) 您必须调用Web服务功能(SOAP)

GetVersionContents(ID, versionNum)

to get the actual data from which you can create a local file. 获取实际的数据,您可以从中创建本地文件。

谢谢您的回答,但在与我公司的Livelink部门联系后,我发现我需要在单独的端口上访问此服务以允许正确的身份验证类型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM