控件
- 字符串转date :DateTime.ParseExact(str,“yyyyMMdd”,system.Globalization.CultureInfo.InvariantCulture).Tostring(“yyyy-MM-dd”)
- uipath 活动包文档:https://docs.uipath.com/activities/lang-zh_CN/docs/about-the-excel-activities-pack
- uipath OC文档:https://docs.uipath.com/orchestrator/v0/docs
- cron expression https://www.cnblogs.com/personblog/p/11245992.html https://www.freeformatter.com/cron-expression-generator-quartz.html
- 判断字典键是否存在于其它字典中,如果不存在添加到datatable中
var dict = new Dictionary<string,object>();
out_NewStamp = in_Stamp 是一个datatable
foreach(KeyValuePair<string,string> pair in rawDict) 创建一个键值存储遍历的字典
if(!dict.ContainsKey(pair.Key)) && !filterDict.ContainsKey(pair.Key)){
out_Flag = true;
out_NewStamp.Rows.Add(new Object[]{“'” + pair.Key,Pair.Value});
} - OC 定时 多时间段可以这么写 Advanced => 0 0 12,13,14 * * ? 代表12 13 14 点
- 压缩文件
Fastzip Fastzipmethod = New FastZip()
invoke method
TargetObject = Fastzipmethod
MethodName = CreateZip
Parameters有 1.in string zipurl[zip路径]
2.in string fileurl[存放zip的文件夹]
3.in Boolean False
4.in string “” - 解压密码压缩包
1.查看是否import ICSharpCode.SharpZipLib.Zip
2.赋值 Fastzip zip = new ICSharpCode.SharpZipLib.Zip.Fastzip()
3.zip.password = “密码写在此处”
4.Invoke method
TargetObject = zip
MethodName = ExtractZip
Parameters有 1.in string zip路径
2.in string 解压到路径
3.in string “” - 打包压缩包
#1.查看是否import ICSharpCode.SharpZipLib.Zip
2.赋值 Fastzip zip = new FastZip()
4.Invoke method
TargetObject = zip
MethodName = CreateZip
Parameters有 1.in string zip路径
2.in string 解压到路径
3.in boolean false
4.in string “” - 获取文件的大小 object filesize = New system.io.fileinfo(文件路径).length / 1024
- datatable 更改列名 数据表.columns(列名).columnsname
- 判断一个列表是否包含另一个列表
a = New List(Of int) from{1,2,3,4}
b = New List(Of int) from{1,2,3,4,5}
a.Addrange(b) 通过invoke method
c = a.union(b) 合并去重
c = a.concat(b) 合并不去重
通过计算c的长度就可以判断是否包含 - 更改列明dataDt.Columns(“Name”).ColumnName = “Name_Old”
- ArrayList List = New ArrayList();
List.Add(ture)
List.Add(1)
List.AddRange(New int[]{1,2,3,4})
List.Clear()
List.remove(value)
List.removeAt(index)
List.removerange(startindex,后面几位)
List.Reverse()反转
List.sort()
string.Equals(string,stringcomparison.ordinalignorecase) 是忽略比对的大小写
s.split(new char[] {“-”,“”+}, stringsplitoptions.removeemptyentries) 是分割char[] 里的字符,并把原先字符转换为“”,后面是去除空,只剩需要的string[] - 清空excel sheet 页
Sub clearEntireSheet()
Sheets(“Sheet名字”).Cells.Clear
End Sub - clone datatable 添加row 用invoke method 并使用 importrow
- 字符串换行符分割成list类型
list = 字符串.Split(vbcrlf.ToCharArray, stringSplitOptions.RemoveEmptyEntries) - 密码格式转字符串格式
string = new System.Net.NetworkCredential(string.Empty, 密码变量).Password - uipath 字符串过滤换行
str.replace(“”& vbLf,“”).replace(“”&vbTab,“”).replace(“”&vbCr,“”) - robot license 反激活
https://www.jianshu.com/p/1f37143f02db - string=strings.split(string1,vbcrlf) vbcrlf 为换行符
- 下滑活动
scroll.activity - 谷歌崩溃
https://www.nginx.cn/5394.html - 更改文件名称
FileSystem.Rename(OldName,NewName) - 设置字典并传参
定义变量为dic<string,object>
new dic(Of string,object)from{{“name”,joker}}等
或
安装依赖包Microsoft.Activities.Extensions
搜索dic进行添加 - 设置excel单元格颜色 UiPath.Excel.Activities.ExcelSetRangeColor
- 计算列表长度用UBound.(数组) LBound(数组)为最小值,一般为0
- 结果.SpecificContent(“key值”).tostring.trim
- Directory.GetFiles(path) 获取文件夹下的所有文件
- Directory.GetDirectories( “back_up”) 获取文件夹下的所有文件夹
- Directory.GetFiles( “back_up”,".xlsx") — 用替代不确定的内容,括号里前面是路径,后边是正则匹配
- new DirectoryInfo(“back_up”).GetFiles(“*.xlsx”)
- 获取密码 格式转换 SecurePassword=new System.Net.NetworkCredential(“”,Password).SecurePassword
- invoke code 调用vb.net代码
- invoke vba 调用vba代码
- double.Tostring(“F0”) 不显示小数点
- double.Tostring(“F1”) 显示一位小数点
- item.Attachments.Count 获取一个邮箱有多少个附件
- directory.Getfiles() 获取指定文件夹中的所有文件
- anchor base 锚点
- Find Element 定位某一固定元素
- get mail messages 查看/检索邮件
- get outlook mail messages 通过筛选获取24小时内的邮件
- send mail messages 发送邮件
- read text file 获取文本内容
- take screenshot 生成png图片
- try catch try…catches…finally
- maximize window 窗口最大化
- open browser 打开网址
- click text 鼠标点击
- hover 鼠标悬停
- type into 文本输入
- Contains(“u”) 判断是否包含u
- set to clipboard 设置剪切
- get from clipboard 获取剪切
- get full text 获取全部文本
- textexists 判断文本是否存在
- uielementexists 判断元素是否存在
- imagefound 判断图像是否存在
- Convert.ToInt32(item.ToString) 类型转换成int
- 在log message 活动中添加 rethrow活动 捕获错误终止信息,并显示错误
信息的
1提示框
流程控制语句
- new Random().next(1,100) 随机数
uipath调用python脚本
- python scope python运行环境
- 属性path 路径 x86 python_36
- load python script 脚本文件路径
- 属性result返回值,定义类型为pythonobject
- invoke pyhton method 调用脚本
- 属性instance 调用对象
- 属性name python脚本函数名
- result 返回值
- get python object 获取返回值
- message box 打印
uipath日期格式化
- Now.ToString 当天时间
- Now.ToString(“yyyyMMdd”) 当天日期
- Now.ToString(“yyyy-MM-dd”) 当天日期
- Now.ToString(“hh:mm:ss”) 当天时间
- Now.AddDays(3).ToString(“yyyyMMdd”) 3天后日期
- Now.AddDays(-3).ToString(“yyyyMMdd”) 3天前日期
- Now.AddMonths(3).ToString(“yyyyMMdd”) 3月后日期
- Now.AddMonths(-3).ToString(“yyyyMMdd”) 3月前日期
- Now.AddYears(3).ToString(“yyyyMMdd”) 3年后日期
- Now.AddYears(-3).ToString(“yyyyMMdd”) 3年后日期
excel
-
insert/delete row 插入/删除行
-
insert/delete column 插入/删除列
- 具体看属性参数
-
Now.Second.Tostring 秒数
-
item.subject.Tostring 邮箱主题
-
item.Sender.Tostring 邮箱发送者
-
rows_excel.Rows.Count() excel行数
-
Directory.GetFiles(“路径”).Length 文件夹下的文件数
-
substring(0,4) 取索引0-4的值