Question

5
Replies
1080
Views
Jessica Visocchi (JessicaV8159)
NA

NA
US
JessicaV8159 Member since 2019 7 posts
NA
Posted: March 7, 2019
Last activity: March 15, 2019
Posted: 7 Mar 2019 16:12 EST
Last activity: 15 Mar 2019 1:02 EDT
Closed
Solved

Combine two strings from user input from Windows Form

Hi,

I am stuck on a portion of my automation workflow where I am combining two strings to create a file path. The first string/portion of the file path is static ("C:\Users\Name\"). The second string is dynamic and is the desired file name that is input into a text box on a Windows Form by the user. My desired outcome is to combine the two strings and output the complete file path ("C:\Users\Name\FileName.txt") into another text box on the Windows Form. I have attempted to do this by creating a script construct (see example code below), but am getting errors now that the user-friendly script constructs window has been removed from Pega Robotics Studio. Is there an easier way to accomplish this?

Example code:

public sealed class Script
{
public string FullPathName()
{
string txtFileName = Console.ReadLine();
string[] paths = {@"C:\Users\Name\", txtFileName, ".txt"};
string txtPathName = Path.Combine(paths);
return txtPathName;
}
}
DevOps Testing Applications Robotic Process Automation System Administration Upgrades
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.