System.IO.IOException: The handle is invalid.

本文详细介绍了在使用SteamWriter进行文件写入操作时遇到IOException问题的排查步骤及解决方案,帮助开发者解决该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

System.IO.IOException: The handle is invalid.
00022846 11:39:49.098 AM [892]
00022847 11:39:49.098 AM [892] at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
00022848 11:39:49.098 AM [892] at System.IO.__Error.WinIOError()
00022849 11:39:49.098 AM [892] at System.Threading.EventWaitHandle.Set()
00022850 11:39:49.098 AM [892] at System.IO.Ports.SerialStream.AsyncFSCallback(U

 

SteamWriter 对文件的写入操作时出现的问题。

 

转载于:https://www.cnblogs.com/fdyang/p/3376007.html

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Starting ChromeDriver 138.0.7204.157 (e533e98b1267baa1f1c46d666b120e64e5146aa9-refs/branch-heads/7204@{#2046}) on port 56169 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully on port 56169. 七月 22, 2025 3:00:19 下午 org.openqa.selenium.remote.ProtocolHandshake createSession 信息: Detected dialect: W3C 七月 22, 2025 3:00:19 下午 org.openqa.selenium.remote.http.WebSocket$Listener onError 警告: Invalid Status code=403 text=Forbidden java.io.IOException: Invalid Status code=403 text=Forbidden at org.asynchttpclient.netty.handler.WebSocketHandler.abort(WebSocketHandler.java:92) at org.asynchttpclient.netty.handler.WebSocketHandler.handleRead(WebSocketHandler.java:118) at org.asynchttpclient.netty.handler.AsyncHttpClientHandler.channelRead(AsyncHttpClientHandler.java:78) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:314) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:435) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:279) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748) Exception in thread "main" org.openqa.selenium.remote.http.ConnectionFailedException: Unable to establish websocket connection to http://localhost:63834/devtools/browser/40d77a6b-9ee5-4802-8897-2b3b99043dbd Build info: version: '4.1.3', revision: '7b1ebf28ef' System info: host: 'DESKTOP-I4PMGD7', ip: '192.168.158.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_281' Driver info: driver.version: ChromeDriver at org.openqa.selenium.remote.http.netty.NettyWebSocket.<init>(NettyWebSocket.java:104) at org.openqa.selenium.remote.http.netty.NettyWebSocket.lambda$create$3(NettyWebSocket.java:137) at org.openqa.selenium.remote.http.netty.NettyClient.openSocket(NettyClient.java:132) at org.openqa.selenium.devtools.Connection.<init>(Connection.java:77) at org.openqa.selenium.chromium.ChromiumDriver.lambda$new$2(ChromiumDriver.java:124) at java.util.Optional.map(Optional.java:215) at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:122) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:106) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:93) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:82) at org.example.selenium.SeleniumDemo.main(SeleniumDemo.java:15)什么问题?怎么解决?
最新发布
07-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值