-
Sep 18th, 2013, 04:00 AM
#1
Thread Starter
Registered User
creating multiple object dynamicly
i have build a project that can view multiples computer client's screen. but currently i need to declare one object for each client and set the ip of the client staticly.
can i use loop to create an object? how to do it..currently, this is my code for each client on my networks.
Dim mjpegSource1 As New MJPEGStream("http://192.168.1.50:2097/video.cgi")
VideoSourcePlayer1.VideoSource = mjpegSource1
VideoSourcePlayer1.Start()
Dim mjpegSource2 As New MJPEGStream("http://192.168.1.50:2097/video.cgi")
VideoSourcePlayer2.VideoSource = mjpegSource2
VideoSourcePlayer2.Start()
Dim mjpegSource3 As New MJPEGStream("http://192.168.1.50:2097/video.cgi")
VideoSourcePlayer3.VideoSource = mjpegSource3
VideoSourcePlayer3.Start()
Dim mjpegSource4 As New MJPEGStream("http://192.168.1.50:2097/video.cgi")
VideoSourcePlayer4.VideoSource = mjpegSource4
VideoSourcePlayer4.Start()
please help...im using .net framework 3.5 and that object had come from AForge.Video
-
Sep 18th, 2013, 06:00 AM
#2
Re: creating multiple object dynamicly
Moved from the CodeBank (which is for sharing code rather than posting questions )
-
Sep 18th, 2013, 10:46 AM
#3
Re: creating multiple object dynamicly
Originally Posted by syedkamal92
can i use loop to create an object?
Yes you can use a loop in combination with an array of video sources. You enumerate the video sources and for each one you instantiate a new MJPEGStream object and add that to a list or collection.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|