Aras Innovator-获取文件的物理地址

在Aras开发过程中,有时需要文件的物理地址(即文件在服务器中的具体文件夹),此处说明文件的物理地址的获取方式。

1  获取文件的ID,以下图为例,文件ID为B46047D9520D43EF9D63D78A5DAD3FC8;则在数据仓库中的位置为:

2  以下为二次开发过程中,获取文件物理位置的代码(C#):

string fileid=this.getProperty("fileid");///获取参数fileid,此为文件的ID
Item file=inn.getItemById("file",fileid);        
XmlDocument xmlDoc = new XmlDocument();        
string _xmlpath =System.AppDomain.CurrentDomain.BaseDirectory.Replace("Innovator\\Server\\","VaultServerConfig.xml");        
xmlDoc.Load(_xmlpath);   //读取VaultServerConfig.xml          
        
XmlNode pathNode = xmlDoc.SelectSingleNode("./VaultServer/LocalPath");        
string strfullPath = pathNode.InnerText;       ///获取数据仓库的物理位置    
string DBName= CCO.DB.DatabaseName;   ///获取数据库名称        
string Fileone = fileid.Substring(0,1);  ///获取文件ID第一位    
string FileTwo =  fileid.Substring(1,2);     ///获取文件ID第二,三位        
string FileThree =  fileid.Substring(3);     ///获取文件ID余下的部分
 ///组合为最终的物理路径
strfullPath = strfullPath + DBName + "\\"+Fileone + "\\" +FileTwo+"\\"+FileThree+"\\"+file.getProperty("filename");    

  • 17
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值