none
c# start process python.exe scriptedsandbox64.exe has stopped RRS feed

  • Question

  • after correct path , got scriptedsandbox64.exe has stopped

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Timers;
    using System.Windows.Forms;
    using System.Threading;
    
    namespace TransparentWindow
    {
        public partial class Form1 : Form
        {
            System.Timers.Timer timer;
            private static Form1 theform;
            public Form1()
            {
                InitializeComponent();
                this.Opacity = 0.5;
                this.TopMost = true;
                theform = this;
                timer = new System.Timers.Timer(10*1000);
                timer.Elapsed += OnTimedEvent;
                timer.Enabled = true;
                timer.AutoReset = true;
                timer.Start();
            }
            private static void OnTimedEvent(object source, ElapsedEventArgs e)
            {
                theform.Invoke(new MethodInvoker(delegate { theform.WindowState = FormWindowState.Minimized; }));
                theform.Invoke(new MethodInvoker(delegate { theform.Refresh(); }));
    
                ProcessStartInfo start = new ProcessStartInfo();
                start.FileName = @"C:\Python27\python.exe";
                start.WorkingDirectory = @"C:\Users\martlee2\Documents\Visual Studio 2017\Projects\TransparentWindow\TransparentWindow\bin\Debug\";
                start.Arguments = @" C:\Users\martlee2\Documents\Visual Studio 2017\Projects\TransparentWindow\TransparentWindow\bin\Debug\comparephoto.py --first 08102017.png  --second 09102017.png";
                start.UseShellExecute = true;
                start.CreateNoWindow = false;
                Process process = Process.Start(start);
                process.WaitForExit();
                process.Close();
                Image myimage = new Bitmap(@"C:\Users\martlee2\Documents\Visual Studio 2017\Projects\TransparentWindow\TransparentWindow\bin\Debug\ImageC.png");
                theform.BackgroundImage = myimage;
                theform.Invoke(new MethodInvoker(delegate { theform.WindowState = FormWindowState.Maximized; }));
                theform.Invoke(new MethodInvoker(delegate { theform.Refresh(); }));
            }
        }
    }
    


    MEALY

    • Moved by Stanly Fan Tuesday, October 31, 2017 6:57 AM
    Monday, October 9, 2017 11:50 PM

All replies

  • Hi MEALY,

    Please disable the Diagnostic tool under:

    Tools -> Options -> Debugging -> General -> Enable Diagnostic Tools while debugging

    More details please refer to the following similar document:

    ScriptedSandbox64.exe has stopped working - Visual Studio 2015.

    Hope this helps!

    Best Regards,

    Stanly


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Bob Ding Wednesday, October 11, 2017 8:52 AM
    Tuesday, October 10, 2017 6:44 AM
  • my python script 

    has write file and move file, but it can not do these even if it can run the script

    https://drive.google.com/file/d/0Bxs_ao6uuBDUc3hlc0plSU5fTTg/view?usp=sharing

    if os.path.isfile(r'C:\Users\martlee2\Documents\Visual Studio 2017\Projects\TransparentWindow\TransparentWindow\bin\Debug\08102017.png'):
        os.remove(r'C:\Users\martlee2\Documents\Visual Studio 2017\Projects\TransparentWindow\TransparentWindow\bin\Debug\08102017.png')
    
    shutil.move(r'C:\Users\martlee2\Documents\Visual Studio 2017\Projects\TransparentWindow\TransparentWindow\bin\Debug\09102017.png', r'C:\Users\martlee2\Documents\Visual Studio 2017\Projects\TransparentWindow\TransparentWindow\bin\Debug\08102017.png')
    snapshot = ImageGrab.grab()
    save_path = r'C:\Users\martlee2\Documents\Visual Studio 2017\Projects\TransparentWindow\TransparentWindow\bin\Debug\09102017.png'
    snapshot.save(save_path)
    
    cv2.imwrite("imageC.png", dst)


    MEALY


    Tuesday, October 10, 2017 2:22 PM
  • Hi MEALY,

    If your issue is the scriptedsandbox64.exe has stopped, you can refer to the reply as I posted above.

    If the issue is more related to some code with python, it will be more appropriate to ask your question at Python Forum.

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Regards

    Stanly


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, October 11, 2017 7:20 AM