環境/言語:[WindowsXP Microsoft VisualBasic2010]
分類:[.NET]
Public Class Form1 Private objSck As New System.Net.Sockets.TcpClient Private objStm As System.Net.Sockets.NetworkStream Private Sub Button1_Click( _ ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles Button1.Click objSck.Connect("192.51.248.211", 5123) objStm = objSck.GetStream() End Sub Private Sub Button2_Click( _ ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles Button2.Click ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) objStm.Close() objSck.Close() End Sub End Class
分類:[.NET]
Public Class Form1
Private objSck As New System.Net.Sockets.TcpClient
Private objStm As System.Net.Sockets.NetworkStream
Private Sub Button1_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
objSck.Connect("192.51.248.211", 5123)
objStm = objSck.GetStream()
End Sub
Private Sub Button2_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button2.Click
ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs)
objStm.Close()
objSck.Close()
End Sub
End Class
ボタン1を押すとOPEN、ボタン2を押すとCLOSEするようにしたのですが、起動一回目のボタン1でOPEN>ボタン2でCLOSEまでは成功するのですが再度ボタン1を押してもOPENしてくれません・・・
理由や解決法が分かる方いらっしゃいますでしょうか?