.NET Remoting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a picture window that will capture the desktop image with the mouse X
& Y axsis. I would like to know how I can transmit or transport the remote
image from the remote machine to my local machine and into the same picture
window name and space? Also, are there any links to .NET remoting for VB?
Most of the things I've found including Ingo Rammer's book was VC# and I'm
just learning VB, and the two aren't even close in similarities that I can
see. All looks GREEK..LOL

Also, tips on sending bitmaps, textbox information, listbox and treeview box
information from one system to another using TCP would be greatly
appreciated. I don't want use any prefab dll's and or Active X controls,
since I don't know what's in them and the software I'm building will allow
access to people's computers for the purpose of repairing the potential
software exploits of spyware, adware, viruses etc. We are a nonprofit
organization developing this software internally.

Michael
 
Hi Michael,

I think you may take a look at the sample below.
Managing Your Remote Windows Clipboard
http://msdn.microsoft.com/msdnmag/issues/03/09/CuttingEdge/

Also many windows internal structure is not valid across process to say
nothing of across machine.
e.g. the Windows Hanlder(HWND), the Windows Hanlder is assigned by System.
i.e. we can not create a windows and assign a windows handler to it.
So the possible way is to marshal the content of a windows(e.g. the
Size,position, color and others you want), then another machine we can
create a windows and assign the values to it. e.g. the Size...)


Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Michael,

Here is some code snippet for your reference.
[Client code]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim chan As New TCPChannel(8086)
ChannelServices.RegisterChannel(chan, True)

Dim obj As TestObj

obj = CType(Activator.GetObject(GetType(TestObj),
"tcp://myserver:8085/SayHello"), TestObj)
Dim bt As Drawing.Bitmap = Bitmap.FromStream(obj.rtBitmap())
Console.WriteLine(bt.Height)
bt.Save("C:\" & TextBox1.Text & ".bmp")
Console.WriteLine("Save OK")
End Sub

[RemoteObj]
Imports System.Runtime.Remoting
Imports System.Drawing
Imports System.IO
Public Class TestObj
Inherits MarshalByRefObject
Public Function rtBitmap() As MemoryStream
Dim ms As New MemoryStream
Dim bmp As Bitmap = New Bitmap("C:\test.bmp")
bmp.Save(ms, Imaging.ImageFormat.Bmp)
Return ms
End Function
End Class

[Server]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' creating a custom formatter for your TcpChannel sink chain.
Dim provider As New BinaryServerFormatterSinkProvider
provider.TypeFilterLevel = TypeFilterLevel.Full

' creating the dictionary to set the port on the channel instance.
Dim props As New Hashtable
props("port") = 8085

' pass the props for the port setting and the server provider in
the server chain argument. (Client remains null (Nothing) here.)
Dim chan As New TcpChannel(props, Nothing, provider)
ChannelServices.RegisterChannel(chan, True)

RemotingConfiguration.RegisterWellKnownServiceType(GetType(TestObj),
"SayHello", WellKnownObjectMode.SingleCall)

System.Console.WriteLine("Hit <enter> to exit...")
System.Console.ReadLine()

End Sub



Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top