system.stream.io.Write()挂起: [英] system.stream.io.Write() hung:

查看:80
本文介绍了system.stream.io.Write()挂起:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含system.stream.io.Write()的循环


写入函数挂起。我试图提出逻辑来中止或退出调用Stream Write方法的线程。你可以指向正确的逻辑退出或中止调用写入的线程。我给了你一个示例代码片段。

 

clsStream = clsRequest.GetRequestStream()
clsStream.WriteTimeout = 5000

对于偏移量As UInteger = 0 To File.Length Step

'代码挂在下面的行上。我试图在

a'一定的秒数后退出线程

clsStream.Write(File,offset,chunkSize)
Application.DoEvents()
Me.Refresh()
下一步





pianoboyCoder

解决方案

< blockquote>

我有一个包含system.stream.io.Write()的循环


写入函数挂起。我试图提出逻辑来中止或退出调用Stream Write方法的线程。你可以指向正确的逻辑退出或中止调用写入的线程。我给了你一个示例代码片段。

 

clsStream = clsRequest.GetRequestStream()
clsStream.WriteTimeout = 5000

For offset As UInteger = 0 To File.Length Step

'代码挂在下面的行上。我试图在

a'一定的秒数后退出线程

clsStream.Write(File,offset,chunkSize)
Application.DoEvents()
Me.Refresh()
下一步



I have a loop that contains a system.stream.io.Write()

The write function gets hung. I am trying to come up with logic to abort or back out of the thread that's calling the Stream Write method. Can you point to the right logic exit or abort the thread that's call the write. I have gave you a sample code snippet.

clsStream = clsRequest.GetRequestStream() clsStream.WriteTimeout = 5000 For offset As UInteger = 0 To File.Length Step

'The code gets hung on the line below. I am trying to backout of thread after

a 'certain amount of seconds

clsStream.Write(File, offset, chunkSize) Application.DoEvents() Me.Refresh() Next


pianoboyCoder

解决方案

I have a loop that contains a system.stream.io.Write()

The write function gets hung. I am trying to come up with logic to abort or back out of the thread that's calling the Stream Write method. Can you point to the right logic exit or abort the thread that's call the write. I have gave you a sample code snippet.

clsStream = clsRequest.GetRequestStream() clsStream.WriteTimeout = 5000 For offset As UInteger = 0 To File.Length Step

'The code gets hung on the line below. I am trying to backout of thread after

a 'certain amount of seconds

clsStream.Write(File, offset, chunkSize) Application.DoEvents() Me.Refresh() Next


这篇关于system.stream.io.Write()挂起:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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