远程桌面会在网络中断时影响Windows应用程序 [英] Remote Desktop Affects Windows Application on network interruption

查看:150
本文介绍了远程桌面会在网络中断时影响Windows应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了演示我的问题,我有一个非常简单的VB Windows应用程序。它

有一个用于显示计数器的文本框,一个用于重置

计数器的按钮,以及一个每秒递增计数器的计时器。


我远程桌面到托管此应用程序的计算机并运行

应用程序。它启动并显示计数器每增加一个
秒。如果我断开两台计算机之间的网络连接10 / b
秒并重新连接,则应用程序已挂起。虽然网络已经断开连接 - 我的计数器没有递增。


如果我运行相同的测试,但在断开连接之前最小化应用程序,<然后在重新连接和取消最小化时,显然计数器

在网络断开时继续运行。


我尝试了另一个测试,我启动了这个应用程序和一个类似的应用程序

。我把一个最小化,另一个离开了另一个。我断开了网络连接并重新连接了b $ b。在取消最小化之后,很明显

,当网络

断开连接时,两个应用程序都无法增加计数器。


关于导致这个问题的原因以及是否有解决方法的任何想法

(期望的行为是内部计数器继续增加

无论网络如何连接。


谢谢

To demonstrate my problem, I have a very simple VB Windows application. It
has a text box that is used to display a counter, a button to reset the
counter, and a timer that increments the counter every second.

I remote desktop to the computer hosting this application and run the
application. It starts up and displays the counter incrementing every
second. If I disconnect the network cable between the two computers for 10
seconds and reconnect it, the application has "hung" while the network has
been disconnected -- my counter has not been incrementing.

If I run the same test, but minimize the application before disconnecting,
then upon reconnect and un-minimizing, it is evident that the counter
continued to run while the network was disconnected.

I tried another test where I started up this application and an application
that was similar. I minimized one and left the other alone. I disconnected
the network and re-connected. After un-minimizing the one, it was evident
that BOTH applications failed to increment their counters while the network
was disconnected.

Any ideas on what is causing this problem and if there is a way around it
(the desired behavior is that internally the counter continues to increment
regardless of the network connectivity.

Thanks

推荐答案




根据我的理解,您将远程桌面B连接到计算机A并在计算机A上运行

应用程序。当应用程序运行时,您断开连接

两台计算机之间的网络电缆。一段时间后,你重新连接

网络,发现应用程序已经挂起,而网络因为计数器已经断开连接在应用程序中还没有增加。如果我不在基地,请随时让我知道w。


我根据您的描述进行了测试,但我没有重现

问题。

我创建一个类似于你的WinForm应用程序并将其放在一台机器上。

安装了Windows XP。我将远程桌面安装的Vista安装到机器上

安装了Windows XP并运行应用程序。


应用程序启动并显示计数器递增每个

秒。当表单上的texbox显示10时,我断开网络

电缆。 10秒钟后,我重新连接网线。 Vista机器

尝试重新连接远程桌面连接。完成

重新连接后,我看到表单上的文本框显示为20.


在断开网络之前,我还有一个最小化表单的测试

电缆。结果是当网络断开连接时应用程序继续运行。


我认为问题可能与远程桌面连接有关。当

断开网线时,您可以直接登录远程连接的机器,以查看应用程序是否真的挂起。

你能告诉我你的远程桌面操作系统和

远程连接的机器分别是什么?正如我上面提到的,在我的

测试中,远程桌面安装了Windows XP,连接的机器遥控器连接到了Windows Vista。


如果您有什么不清楚的地方,请随时告诉我。


此致,

Linda Liu

Microsoft在线社区支持


=============================== ===================

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========


此帖子按原样提供。没有保证,也没有授予任何权利。

Hi,

Based on my understanding, you remote desktop B to a computer A and runs an
application on computer A. When the application is run, you disconnect the
network cable between the two computers. After some time, you reconnect the
network and find that the application has "hung" while the network has been
disconnected because the counter in the application has not been
incrementing. If I''m off base, please feel free to let me know.

I performed a test based on your description, but didn''t reproduce the
problem on my part.

I create a WinForm application similar to yours and place it on a machine
installed Windows XP. I remote a desktop installed Vista to the machine
installed Windows XP and run the application.

The application starts up and displays the counter incrementing every
second. When the texbox on the form shows 10, I disconnect the network
cable. After 10 seconds, I reconnect the network cable. The Vista machine
tries to reconnect the remote desktop connection. After it finishes the
reconnection, I see the textbox on the form displayes 20.

I also have a test minimizing the form before I disconnect the network
cable. The result is that the application keep running when the network is
disconnected.

I think the problem may be related to the remote desktop connection. When
the network cable is disconnected, you may login the machine that was
remote connected to directly to see whether the application is really hung.

Could you tell me what the OS of your remote desktop and the machine that
is remote connected to are respectively? As I have mentioned above, in my
test, the remote desktop is intalled Windows XP and the the machine remote
connected to is intalled Windows Vista.

If you have anything unclear, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


感谢您的回复。您对问题的理解是正确的。在

我的情况计算机B正在运行远程桌面运行Windows

XP Professional 2002 Service Pack 2.计算机A正在运行Windows Server

2003标准版Service Pack 1.


我今天早上重复测试,两台计算机都运行Windows

XP Professional 2002 Service Pack 2 - 相同的结果。我在断开它们之间的网线之后登录了

计算机A,

应用程序现在正在运行,但计数低于应该的数量

(基本上它丢失了断开网络之间的计数直到

我可以登录)。


然后我用计算机A重复测试运行Windows Vista Ultimate

Release Candidate 1 - Build 5600和运行Windows XP的计算机B

Professional 2002 Service Pack 2 - 具有相同的结果(计数不是

在网络断开时更新。


VB应用程序是使用Visual Studio 2005作为发行版本构建的。

代码本身是:


文件Form1.vb:


公共类Form1


Dim m_counter As Integer = 0


Private Sub Button1_MouseClick(ByVal sender As Object,ByVal e As

System.Windows.Forms.MouseEventArgs)Handles Butto n1.MouseClick

m_counter = 0

TextBox1.Text = m_counter

End Sub


私人Sub Timer1_Tick(ByVal sender As Object,ByVal e As

System.EventArgs)处理Timer1.Tick

m_counter = m_counter + 1

TextBox1。 Text = m_counter

End Sub


Public Sub New()


''这个电话需要Windows窗体设计器。

InitializeComponent()

''在InitializeComponent()调用后添加任何初始化。

Timer1.Enabled =真实


结束次级

结束班级


档案Form1.Designer.vb:


< Global.Microsoft.VisualBasic.CompilerServices.Des ignerGenerated()_

Partial Class Form1

继承System.Windows.Forms.Form


''表格覆盖处理以清理组件列表。

< System.Diagnostics.DebuggerNonUserCode()_

受保护覆盖s Sub Dispose(ByVal disposing As Boolean)

如果处理AndAlso组件IsNot Nothing那么

components.Dispose()

结束如果

MyBase.Dispose(处理)

结束子


''Windows窗体设计师要求

私人组件为System.ComponentModel.IContainer


''注意:Windows窗体设计器需要以下过程

''可以使用Windows修改它表单设计器。

''不要使用代码编辑器修改它。

< System.Diagnostics.DebuggerStepThrough()_

Private Sub InitializeComponent()

Me.components = New System.ComponentModel.Container

Me.TextBox1 = New System.Windows.Forms.TextBox

Me .Button1 = New System.Windows.Forms.Button

Me.Timer1 = New System.Windows.Forms.Timer(Me.components)

Me.SuspendLayout()

''

''TextBox1

''
Me.TextBox1.Location = New System.Drawing.Point(68,51)

Me.TextBox1.Name =" TextBox1"

Me.TextBox1.Size = New System.Drawing.Size(124,22)

Me.TextBox1.TabIndex = 0

''

''Button1

''

Me.Button1.Location = New System.Drawing.Point(92,111)

Me.Button1。 Name =" Button1"

Me.Button1.Size = New System.Drawing.Size(75,37)

Me.Button1.TabIndex = 1

Me.Button1.Text ="重置"

Me.Button1.UseVisualStyleBackColor = True

''

''Timer1

''

Me.Timer1.Interval = 1000

''

''Form1

''

Me.AutoScaleDimensions =新的System.Drawing.SizeF(8.0!,16.0!)

Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode .Font

Me.ClientSize = New System.Drawing.Size(269,194)

Me.Controls.Add(Me.Button1)

Me.Controls.Add(Me.TextBox1)

Me.Name =" Form1"

Me.RightToLeftLayout = True

Me.Text =RDP测试应用程序

Me.ResumeLayout(错误)

Me.PerformLayout()


End Sub

Friend WithEvents TextBox1 As System.Windows.Forms.TextBox

Friend WithEvents Button1 As System.Windows.Forms.Button

Friend WithEvents Timer1 As System。 Windows.Forms.Timer


结束类


如果有助于我发送Visual Studio文件和/或

可执行文件,请告诉我。

非常感谢您的帮助。

Linda Liu [MSFT]"写道:
Thank-you for your reply. Your understanding of the problem is correct. In
my situation computer B that was doing the remote desktop is running Windows
XP Professional 2002 Service Pack 2. Computer A is running Windows Server
2003 Standard Edition Service Pack 1.

I repeated the test this morning where both computers were running Windows
XP Professional 2002 Service Pack 2 -- with the same results. I logged into
computer A after disconnecting the network cable between them, the
application was now running, but the count was below what it should have been
(essentially it lost the counts between the network being disconnected until
I could get logged in).

I then repeated the test with computer A running Windows Vista Ultimate
Release Candidate 1 - Build 5600 and computer B running Windows XP
Professional 2002 Service Pack 2 -- with the same results (count was not
being updated while network was disconnected).

The VB application was built with Visual Studio 2005 as a Release version.
The code itself is:

File Form1.vb:

Public Class Form1

Dim m_counter As Integer = 0

Private Sub Button1_MouseClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles Button1.MouseClick
m_counter = 0
TextBox1.Text = m_counter
End Sub

Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
m_counter = m_counter + 1
TextBox1.Text = m_counter
End Sub

Public Sub New()

'' This call is required by the Windows Form Designer.
InitializeComponent()

'' Add any initialization after the InitializeComponent() call.
Timer1.Enabled = True

End Sub
End Class

File Form1.Designer.vb:

<Global.Microsoft.VisualBasic.CompilerServices.Des ignerGenerated()_
Partial Class Form1
Inherits System.Windows.Forms.Form

''Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()_
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub

''Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

''NOTE: The following procedure is required by the Windows Form Designer
''It can be modified using the Windows Form Designer.
''Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()_
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.SuspendLayout()
''
''TextBox1
''
Me.TextBox1.Location = New System.Drawing.Point(68, 51)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(124, 22)
Me.TextBox1.TabIndex = 0
''
''Button1
''
Me.Button1.Location = New System.Drawing.Point(92, 111)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 37)
Me.Button1.TabIndex = 1
Me.Button1.Text = "Reset"
Me.Button1.UseVisualStyleBackColor = True
''
''Timer1
''
Me.Timer1.Interval = 1000
''
''Form1
''
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(269, 194)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox1)
Me.Name = "Form1"
Me.RightToLeftLayout = True
Me.Text = "RDP Test Application"
Me.ResumeLayout(False)
Me.PerformLayout()

End Sub
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Timer1 As System.Windows.Forms.Timer

End Class

If it would help for me to send the Visual Studio files and/or the
executable, let me know.
Your help is greatly appreciated.
"Linda Liu [MSFT]" wrote:




根据我的理解,您将远程桌面B连接到计算机A并运行应用程序。运行应用程序时,断开两台计算机之间的

网络电缆。一段时间后,您重新连接

网络并发现该应用程序已挂起。虽然网络已经断开连接,因为应用程序中的计数器还没有增加
。如果我不在基地,请随时告诉我。


我根据您的描述进行了测试,但没有重现
$ b我的问题是$ b。


我创建一个类似于你的WinForm应用程序并将其放在一台机器上

安装了Windows XP。我将远程桌面安装的Vista安装到机器上

安装了Windows XP并运行应用程序。


应用程序启动并显示计数器递增每个

秒。当表单上的texbox显示10时,我断开网络

电缆。 10秒钟后,我重新连接网线。 Vista机器

尝试重新连接远程桌面连接。完成

重新连接后,我看到表单上的文本框显示为20.


在断开网络之前,我还有一个最小化表单的测试

电缆。结果是当网络断开连接时应用程序继续运行。


我认为问题可能与远程桌面连接有关。当

断开网线时,您可以直接登录远程连接的机器,以查看应用程序是否真的挂起。

你能告诉我你的远程桌面操作系统和

远程连接的机器分别是什么?正如我上面提到的,在我的

测试中,远程桌面安装了Windows XP,连接的机器遥控器连接到了Windows Vista。


如果您有什么不清楚的地方,请随时告诉我。


此致,

Linda Liu

Microsoft在线社区支持


=============================== ===================

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========


此帖子按原样提供。没有保证,也没有授予任何权利。

Hi,

Based on my understanding, you remote desktop B to a computer A and runs an
application on computer A. When the application is run, you disconnect the
network cable between the two computers. After some time, you reconnect the
network and find that the application has "hung" while the network has been
disconnected because the counter in the application has not been
incrementing. If I''m off base, please feel free to let me know.

I performed a test based on your description, but didn''t reproduce the
problem on my part.

I create a WinForm application similar to yours and place it on a machine
installed Windows XP. I remote a desktop installed Vista to the machine
installed Windows XP and run the application.

The application starts up and displays the counter incrementing every
second. When the texbox on the form shows 10, I disconnect the network
cable. After 10 seconds, I reconnect the network cable. The Vista machine
tries to reconnect the remote desktop connection. After it finishes the
reconnection, I see the textbox on the form displayes 20.

I also have a test minimizing the form before I disconnect the network
cable. The result is that the application keep running when the network is
disconnected.

I think the problem may be related to the remote desktop connection. When
the network cable is disconnected, you may login the machine that was
remote connected to directly to see whether the application is really hung.

Could you tell me what the OS of your remote desktop and the machine that
is remote connected to are respectively? As I have mentioned above, in my
test, the remote desktop is intalled Windows XP and the the machine remote
connected to is intalled Windows Vista.

If you have anything unclear, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.





谢谢你的支持提示响应。


您的应用程序与我的应用程序几乎相同。你能告诉我你怎么用b $ b确定当网线连接时是否挂断应用程序?


你还有提到网络断开后,你将
记录到计算机A中,发现程序正在运行。此时,

网络没有重新连接,它应该证明当网络电缆断开时程序没有挂起。


您可以将申请发送给我进行测试。要获取我的实际电子邮件

地址,请从我显示的电子邮件地址中删除在线。


此致,

琳达刘

微软在线社区支持

Hi,

Thank you for your prompt reponse.

Your application seems almost the same as mine. Could you tell me how you
determine whether the application is hung when the network cable is
disconnected?

You have also mentioned that after the network is disconnected, you log
into the computer A and find that the program is running. At this time, the
network is not reconnected and it should prove that the program does not
hang when the network cable is disconnected.

You may send your application to me for test. To get my actual email
address, remove ''online'' from my displayed email address.

Sincerely,
Linda Liu
Microsoft Online Community Support


这篇关于远程桌面会在网络中断时影响Windows应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆