UIpath开发遇到的问题及解决方法

1.解压缩 

invoke mothod有压缩和解压缩方法(使用方法:target type=system.io.compression.zipfile,MethodName=extracttodirectory,参数传入两个string格式路径),但客户开发环境就是不成功,一直报错(could not load file and assembly:0x80131040)

我尝试了很多办法,包括但不限于安装新版本.net,替换多个地方的zipfile.dll,用invoke code的system.IO.compression.zipfile.extracttodirectory(),均无法解决,翻遍uipath论坛,别人的xaml在自己电脑上能跑,放在开发环境就挂。

最后用vba解决,安装7zip,invoke code里写shell(7z路径+“ x ”+压缩文件路径+“ -o”+解压缩路径,vbhide)

2.linkedlist

ll=new linkedlist(of string)

ll.add/ll.addfirst

for each i in ll

dt.rows.add(i)

3.Excel Application Scope报错

error opening workbook,make sure excel is installed.

在跟客户上线项目的时候生产环境突然爆出这个错误,差点翻车。原来生产环境曾经装了两个excel,有一个卸载不干净,最后卸载全部office软件重装一次解决问题。

4.Windows credential设置密码读取config

客户对项目安全性要求高,在采用attended robot模式下连着生产环境VM不允许A用户跑B用户的项目。我们就采用了windows凭证管理来管控robot读config。

步骤

1)安装uipath.credential.activities package--必要

2)在开始菜单访问credential manager,在windows credential下的generic credential下创建,address为唯一,user name随意,password写config访问的password。

3)打开config文件,f12另存为,tools下拉选项,General Options,输入访问密码。

4)代码中在读config前加入get secure credential,password用一个变量保存,assign一个string变量=new system.NET.NetworkCredential(String.Empty,psw).Password。密码变成明文。读config时加入该string在password里。

5.在For each row里通过datarow改变datatable该行的值

使用indexof可以找到datarow所在的行号:processDT.Rows(processDT.Rows.IndexOf(row))

猜你喜欢

转载自blog.csdn.net/weixin_31808811/article/details/89886218