在不同线程之间进行通信VB.net

我有一个控制台应用程序,可以同时打开多次。为了防止这种情况的发生,我使用Mutex检测新实例,然后按如下所示关闭它:

Private ReadOnly myType As Type = GetType("name of my app")
Dim oMutex As System.Threading.Mutex = New System.Threading.Mutex(False,myType.GUID.ToString()) 

        If oMutex.WaitOne(0,False) = False Then
            Console.WriteLine("Another instance of this app is already running...")            
            oMutex.ReleaseMutex()
            Exit Sub       
        End If

我的问题是如何将数据从这些子实例传递到主实例?

iCMS 回答:在不同线程之间进行通信VB.net

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/1645853.html

大家都在问