How to pass a value to the chrome opened using startinfo

Sherin 0 Reputation points
2023-06-12T14:54:53.5866667+00:00

Hi All,

I am working on an industrial automation project, in which I need to open a web browser-based application from another application. I used the below script to open the application.

dim StartInfo = new System.Diagnostics.ProcessStartInfo;
StartInfo.FileName="chrome";
StartInfo.WorkingDirectory="C:\Program Files (x86)\Google\Chrome\Application"; StartInfo.Arguments="http://00hscadahis01/ReportServer/Pages/ReportViewer.aspx?%2fEventLogReport
System.Diagnostics.Process.Start(StartInfo).ProcessorAffinity =System.Convert.ToInt32((2 ** System.Environment.ProcessorCount()) - 1);

But I couldn't figure out how to pass some values to the textbox in the application that is opened in Chrome. I tried the below script, but it didn't work. It generates an error "

-- Failed for the following reason: The system cannot find the file specified Method Name: system.Diagnostics.Process

Start(System.Diagnostics.ProcessStartInfo)

StartInfo.EnvironmentVariables["DeviceID"]= Me.TagName"; 
StartInfo.UseShellExecute = false;

Any help would be greatly appreciated, Thanks

Sherin.

Developer technologies | .NET | Other
Developer technologies | VB
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 78,006 Reputation points Volunteer Moderator
    2023-06-12T17:10:38.8133333+00:00

    when you open a page in chrome, you pass data via the query string arguments. you sample has one, but it does not look valid. the format of the query string is: ?<p1>=<value1>&<p2=value2>. The application you are calling would need to support setting the textbook based on the query string. see documentation for the application.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.