|
You going to have to be alot more descriptive than that. What do you mean by "control"? Are you saying that you want one PC to click on button on another PC?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i mean ,if the cmdbutton on my computer clicked ,it would affect to the cmdbutton on your computer , which component should i use ? can u give me some advise .
|
|
|
|
|
There isn't any one component. It's not a simple matter of sending a little message to the other machine. You're talking about writing your own little version of PCAnywhere. You'll need to write a server piece, which runs on the computer you want to control, and a client that will run on your machine. Basically, begin researching VNC clients. Search the comments in the VB and C# Forums and you'll come up with lots of mentions and links to some good VNC libraries that you can use.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am building a simple FTP client with download feature. How can i authenticate myself after providing parameters on the FTP server. This the Log In code but the problem is that it is not authenticating me.
Public Function LogIn() As Boolean
m_objClientSocket = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
Dim Ep As IPEndPoint = New IPEndPoint(Dns.Resolve(m_strRemoteHost).AddressList(0), m_intRemotePort)
Try
m_objClientSocket.Connect(Ep)
Catch ex As Exception
MessageString = m_strReply
Throw New IOException("Cannot connect to the Remote Server")
End Try
ReadReply()
If (m_intRetValue <> 220) Then
CloseConnection()
MessageString = m_strReply
Throw New IOException(m_strReply.Substring(4))
End If
SendCommand("USER " & m_strRemoteUser)
If (Not (m_intRetValue = 331 Or m_intRetValue = 202)) Then
CleanUp()
MessageString = m_strReply
Throw New IOException(m_strReply.Substring(4))
End If
If (m_intRetValue <> 230) Then
SendCommand("PASS " & m_strRemoteUser)
If (Not (m_intRetValue = 230 Or m_intRetValue = 202)) Then
CleanUp()
MessageString = m_strReply
Throw New IOException(m_strReply.Substring(4))
End If
End If
m_blnLoggedIn = True
ChangeDirectory(m_strRemotePath)
Return m_blnLoggedIn
End Function
|
|
|
|
|
I am having trouble writing data to my xml file. I already have a StreamReader that reads the data, but when I use StreamWriter to write the data back out to the file, it writes data, but it writes blank data. It clears my file so the next time I try to run my program an error message says it can't find the origional table that was in my file before, of course thats because it isn't there now. any suggestions on what I may be doing wrong? I am writing from a form with a datagrid.
HAPPY HOLIDAYS
|
|
|
|
|
You are probably not closing the file properly after you have written to it. Have a look at the DataSet.ReadXml and DataSet.WriteXml on MSDN, both have examples of how to code it properly:
DataSet.ReadXml - MSDN[^]
DataSet.WriteXml - MSDN[^]
Hope this helps
Tom
|
|
|
|
|
How to know the functions decleared in unknown dll file of some other software
|
|
|
|
|
You might want to look into PE Explorer, here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would like to ask how can i retrieve data from the selected row of the Datagrid.
Thank you.
|
|
|
|
|
|
DataGrid1.SelectedItem.Cells(0).Text
(First Column Value From Selected Row)
'Cause I'm living on things that excite me, be it pastries or lobsters or love... I'm just trying to get by, being quiet and shy, in a world full of push and shove...
Jimmy Buffett - The Wino and I know
|
|
|
|
|
I have a vb6 app with no forms that is run in dos window. How do I output to the window if I want to send a message. No Msgbox (I don't want things popping up)
so I want something like this
c:\ingroup
c:\You must provide a parameter with ingroupc
c:\Example ingroup /i
Something like that if possible?
thanks
|
|
|
|
|
VB6 couldn't target a console app. You have to call into the Win32 API to create a console and output to it. You might want to try here[^] for a couple of console classes for VB6.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks I will take a look at the samples.
Do you happen to know how I pass a error level code back after terminating the code? I want to check in the batch file for errors in the code.
Thanks
I found one thing but I put it in the code and tested it and it booted me out of VB and I lost it
Forgot to save.
|
|
|
|
|
Also wanted to ask if there is an easier way to do this in vb.net?
|
|
|
|
|
All of this is trivial in VB.NET since it, and any other language targeting the .NET Framework, can target a console app. Support for I/O redirection and exit codes are included. Even better support is included in the .NET Framework 2.0 and Visual Studio/Basic .NET 2005.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That would be done with the ExitProcess Win32 API function. VB6 can't do it natively.
Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)
.
.
ExitProcess(returnCode)
This will have the effect of terminating your app immediately, so you better have everything cleaned up before you call this.
Also, when you launch a VB6 app from a batch file, it won't wait for it to complete. Unless, of course, you tell it to using:
START /W vbApp.exe
...ERRORLEVEL statements go here
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
i have strange problem in my project the keybord some time hange and you must trun off the keyborad sokt and trun on again for can type again can you help me and how i save picture in database and view in vb6 program
|
|
|
|
|
Hi! Thanks for you reply.I made a little example using the AsyncCallBack class and BeginInvoke() but i reached a result that i didn't expected.I ran the beginInvoke in a different thread and the callback function is located at the form(main thread).After the beginInvoke() my code proceeded(as expected).Then the execution passed to the callback function(in the form) but it wasn´t running neither on the thread or form context, it was in a completly different thread.Strange?For me it was because i was hopping that the callback executed in the form's context.Am i doing anything wrong or is this correct?
|
|
|
|
|
This is the normal behavoir of the AsyncCallBack class. However, you should not let this tread modify any of the forms controls. This is an Windows UI rule and if you violate it you will pay the price . If you need to modify the forms controls during the call back do the following in the call back function.
Private Sub MyFunct() 'This is your callback function.
If Me.InvokeRequired = True Then
Me.Invoke("Your Delegate here") 'You can create a delegate that matches the call back
'and pass that in. After the invoke the function will be recalled and you will
'end up in the else part of this block
Else
'Do your work here this code is now executing on the UI thread.
End If
End Sub
Forever Developing
|
|
|
|
|
Ok! I made that last question because i have and app that raises an event in a thread and the handler is in the main form. The context of the handler is the thread which fired the event but this isn't happening with the async. Callback, thus my confusion. When i raise and event and check out the name of the current thread it gives me the thread that fired the event, if i check the name with the callback the name isn't from the thread that executed the beginInvoke().But if you say that this is the normal procedure fine by me One less problem for me to handle. But just to know, in what thread is it running? Is it a thread from the thread pool?A system thread?Just out of curiosity...
PS:Ye, i know that is a mistake to modify the UI from another thread.I found out the hard way Thanks for your concerne.
|
|
|
|
|
OK, this is what I belive is happing. The AsyncCallback is creating a new thread to do the work. I am not sure where this tread comes from but I belive it is from the thread pool Dot Net creates on startup. When you call BeginInvoke that tread starts on the function you have told it to execute. When it is finished it will call your finshed call back.
Forever Developing
|
|
|
|
|
Thanks a bunch.
That was what i though.
|
|
|
|
|
Help!
We're getting ready to deploy and I'm trying to build a Launcher application that will run on non-.NET platforms (COM or Win32).
Is there any way to build or compile a VB .NET application to output COM or Win32 code, or do I have to re-write this thing in Visual Studio 6 or InstallShield?
We're shipping tomorrow! Please help!
|
|
|
|
|
This depends on the Level of the Visual Studio Dot Net you have installed. If you have the ability to create C++ applications then you can create byte code exe's "Win32" in C++. If you are asking if a VB.Net application can be compiled as byte code, the answer to that is NO. If you use VB 6.0 then you will get semi-byte code but you will still need the vb runtime. The vb 6 runtime is installed by default for Windows 2000 and greater.
For a very simple launch I would create a native C++ program.
For a more complicated on I would probably use InstallShield. However, I am not sure what you mean by Launcher since InstallShield is a installer application.
Best of Luck
Forever Developing
|
|
|
|