The private void Call window displays Toolstripmenuitem_click (object sender, EventArgs e) {string filepathname = "";//defines the location of the image file (including Path and file name) OpenFileDialog ofd = new OpenFileDialog (); Add Open dialog Box OFD. Filter = "image file |*jpg;*.bmp;*.png,*.tif| all files |*.*"; Set the filter if (OFD. ShowDialog () = = DialogResult.OK)//If you are sure to open the picture, save the file's path and file name to the string variable filepathname {filepathname = ofd. FileName; Include path and file name} else if (OFD. ShowDialog () = = DialogResult.Cancel)//If open, pop-up "Cancel open" window Prompt MessageBox.Show ("Cancel Open"); Establish new system processes System.Diagnostics.Process process = new System.Diagnostics.Process (); Sets the real path and file name of the picture process. Startinfo.filename = Filepathname; Sets the process run parameters, where the picture is displayed in the Maximized window method. Process. startinfo.arguments= "Rundl132.exe C://windows//system32//shimgvw.dll,imageview_fullscreen"; This entry is not available if the shell executes the program, because the system defaults to true, but if the setting must be true process. Startinfo.useshellexecute = true; Here you can change the display style of the form that the process opens, and you can set no process. StArtinfo.windowstyle = System.Diagnostics.ProcessWindowStyle.Hidden; Process. Start (); Process. Close (); }
C # calls the computer's default picture browser software to open the picture