Path Utils - .NET Framework

This library is a custom activity for UiPath.

When using UiPath, I often want to call methods of .NET, such as getting the name of the current

directory, base64 encode the file,These activities are the activities that call those methods.

It provides the following functions.

Combine: Combines an array of strings into a path.

Current Dir: Gets the current working directory.

Path Utils: Returns the absolute path for the specified path string ,checks the existence of

the file ,etc.

Base64 Encode: Base64 Encode.

Base64 Decode: Base64 Decode.

Base64 Encode From File: Base64 Encode from File

ConvertCRLF: Convert the line feed code of the given text.

ToJSONString: An activity that converts arbitrary objects to JSON strings.

Path Utils

Combine Activity

Combines an array of strings into a path. That is as follows:

{"c:\temp","hogehoge"} c:\temp\hogehoge

{"temp","hogehoge"} temp\hogehoge

{"te/mp","hoge\hoge"} te\mp\hoge\hoge

calls System.IO.bine method . And calls String.Replace("/", "\\") method to use

'/' .

Current Dir Activity

Gets the current working directory. only calls Directory.GetCurrentDirectory method.

Path Utils Activity

Specify relative/absolute path and get the following:

Properties

Description

DirectoryPath Basically it returns the same as Path.GetDirectoryName() .

DirExists

returns true if the specified Directory exists (returns false even if it exists if it is a

File).

FileExists

returns true if the specified File exists (returns false even if it exists if it is a

Directory).

FullPath

returns full Path.

Basically it returns the same as Path.GetDirectoryName(). If an existing directory is specified,

even if there is no "\" at the end, the directory path is returned.

For examples:

Path: c:/temp/existsDir/



FullPath: c:\temp\existsDir\

DirectoryPath: c:\temp\existsDir

Path: c:/temp/existsDir



FullPath: c:\temp\existsDir

DirectoryPath: c:\temp\existsDir

The .NET method returns c:\temp

Path: c:/temp/notExistsDir/



FullPath: c:\temp\notExistsDir\

DirectoryPath: c:\temp\notExistsDir

Path: c:/temp/notExistsDir



FullPath: c:\temp\notExistsDir

DirectoryPath: c:\temp

Path: c:/temp/existsOrNotExistsFile.txt



FullPath: c:\temp\existsOrNotExistsFile.txt

DirectoryPath: c:\temp

String Utils

Base64 Encode Activity

Converts a String to its equivalent string representation that is encoded with base-64 digits.

That is as follows:

var result = Convert.ToBase64String(Encoding.GetEncoding("UTF8").GetBytes(text));

Base64 Decode Activity

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download