|
Thank you for helping me on this. But, I get an error on the second line of code: target machine actively refused it.
Let me show you how I have this set up so you can clearly see any problems.
Server - My PC on a network separate application of desktop where listener is
Code:
Dim desktop As SteidingerDesktop = New SteidingerDesktop
Dim localhostAddress As IPAddress = IPAddress.Loopback
Dim tcpList As New TcpListener(localhostAddress, 2048)
tcpList.Start()
Do
Dim tcpcli As TcpClient = tcpList.AcceptTcpClient
Dim ns As NetworkStream = tcpcli.GetStream
Dim sr As New StreamReader(ns)
Dim receivedData As String = sr.ReadLine()
Dim result As Boolean
If receivedData <> "" Then
'Test the received data to see which function to call
If receivedData = "BUYER" Then
result = desktop.getBuyers()
ElseIf receivedData = "SHIP" Then
result = desktop.updateShip()
ElseIf receivedData = "MOVE" Then
result = desktop.updateMove()
ElseIf receivedData = "PHYINV" Then
result = desktop.updatePhyInv()
End If
Try
' resultData = file.ReadAllText(fileName)
Catch ex As Exception
'send back result result = "ERROR"
End Try
'Send result
SendData(ns, result)
End If
sr.Close()
ns.Close()
tcpcli.Close()
If receivedData = "" Then Exit Do
Loop
tcpList.Stop()
Client - mobile device barcode scanner on wireless
Code:Your code.
Dim tcpClient As New System.Net.Sockets.TcpClient()
tcpClient.Connect("ipaddress of my desktop", 2048)
Dim networkStream As NetworkStream = tcpClient.GetStream()
If networkStream.CanWrite And networkStream.CanRead Then
Dim sendBytes() As Byte = Encoding.ASCII.GetBytes("Buyer")
networkStream.Write(sendBytes, 0, sendBytes.Length)
Dim bytes(tcpClient.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
Dim returndata As String = Encoding.ASCII.GetString(bytes, 0, bytes.Length)
End If
Can you look at this code and tell me why I get the error? thank you.
|
|
|
|
|
Hey
I want to draw in a user control, but for some reason it doesn't work. The user control colors blue, but I can't see a yellow circle. Maybe it would be better to make a panel - user control, but I don't know how to do this.
<br />
Public Class cell<br />
Private Sub cell_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
'Set Background of cell (panel)<br />
pnlCell.BackColor = Color.Blue<br />
<br />
'Draw circle in cell (panel)<br />
DrawCircle(New Point(10, 10), 5)<br />
End Sub<br />
<br />
Private Sub DrawCircle(ByVal p As Point, ByVal radius As Integer)<br />
Dim gr As Graphics = pnlCell.CreateGraphics<br />
Dim rect As Rectangle = New Rectangle(p.X - radius, p.Y - radius, 2 * radius, 2 * radius)<br />
gr.FillEllipse(Brushes.Yellow, rect)<br />
End Sub<br />
End Class
|
|
|
|
|
Your drawing code should be in the Paint event of your UserControl, not called from form load.
|
|
|
|
|
N!ck wrote: Dim gr As Graphics = pnlCell.CreateGraphics
To expand on the previous reply - CreateGraphics is used to draw something that is temporary, it gets erased the moment the control redraws itself. After the control loads, it will become visible, and will redraw itself.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I want to take snap shot current application which is running on the other machine.
How Can I go further?
Regards,
sjs4u
|
|
|
|
|
Unless you write two applications, you can't do this. The "other machine" has to be running an application that listens for a connection from your other application running on your machine. When that connection is established and a command given (your choice of what you want to use here), then your client application can take the snapshot and send it back to the server.
|
|
|
|
|
Why are you asking this over and over, on all the forums, but when someone gives you an intelligent answer, you just repeat the question ? It's obviously beyond you, stop spamming the site, and read the replies you have been given.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi i am creating my own application and i wan to have a list simmaler to the contacts list within MSN messenger e.g a pucture with three lines of text along side this driven from a data souce im fine withe everything apart from how do i manipulate the grid view(if this is the correct control) to show a picture in column one with three text rows in colum two?
any help would be grately appreciated
|
|
|
|
|
|
I want to load .exe file which is created using VB.Net or C#.Net Application.
After installing when my computer starts that exe run.
I am creating set up of the project.
|
|
|
|
|
I *think* you're saying you want to add a path to your exe in the startup folder of the run menu, so it starts when the PC starts.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hai SJS4U..
I understood your problem..
for every restart of your PC your application has to be lunch automatically at the start-up.
For this one you have to place your exe stortcut in startup folder..
But We(.net Developers) have a option when we are creating Setup of our application.
Follow the Steps:
--> Goto File System window in setup application.
--> Right Click on the Root (File System on target Machine). U will get the menu ADD SPECIAL FLODER , then select USER'S START MENU.
--> U Will get a Folder in sub-root.
--> Place your EXE short cut in that folder..
--> Built Setup. ( Do Remaining things normally.)
--> Now Install Your Application and restart Your PC.
Thanks
Rajesh B.
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Thanks for the Valuable information.
I trid but it is not running when I restarts the PC.
I Copied shortcut of my exe into the user's start Menu folder.
and Buld it but it is not working.
|
|
|
|
|
It *has* to work. IF the shortcut is there, windows will run it when it starts. No question. The problem lies elsewhere.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi...,
Clarify me u create setup
or
create shortcut manually in the startup folder.
if copied shortcut directly., try with setup it will work 100%.
replay me..
Thanks
Rajesh B
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Yes.
Now its Work
Thank you so much.
Regards,
sjs4u
|
|
|
|
|
Hi friends, i need to know how to get the hash code for an image in vb.net. When i try by using this code i get different hash code for the same image. Please help me any one on this
Dim img As Bitmap
img = pbxPreview.Image
Label2.Text = pbxPreview.Image.GetHashCode().ToString()
|
|
|
|
|
Well, if you get different codes for the same image, that probably means the framework doesn't really support it ( which is odd ). What do you mean by 'the same image', where does it come from ?
If this is true, there's not going to be another way, you'll have to write your own.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
GetHashCode returns the hash of the object instance, not it's data. I figured he'd probably have to dig into some of your C# code to get the image bytes and run that through one of the encryption hashers to get what he wants. True??
|
|
|
|
|
yeah, that's what I was expecting if he needed to write his own.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
This code doesn't generate a hash of the image contents, rather its for the Image object (instance of a class), not it's data.
To generate a hash of the image data, you'll have to treat it as an array of bytes and run that through an encryption hashing algorithm of your choice.
|
|
|
|
|
Hi,
I want to turn on/off power of other machine using theASP.Net.
How can it be possiblr?
Regards,
sjs4u
|
|
|
|
|
Wow.
Start here[^], but also buy a VERY basic ASP.NET book and read it, so you start to have some basic idea of what it is, and what it does. Once you understand what is meant by the term ASP.NET, you will understand why you can't possibly use it to turn any computer off.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi..,
If Client Using windows PC Try to execute "taskkill" at client PC.
EX: taskkill /IM notepad.exe
With the use of the above command try to kill the "svshost.exe" or "exlorer.exe" ( i don't know exaclty.., because i don't want to make experiment in my PC).
Thanks
Rajesh B
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
I want to control it from server machine.
If I want to turn off power of client machine.
Regards,
sjs4u
|
|
|
|