Is it possible to connect to a server and select a camera programmatically?

I have been testing the VideoViewer example from the SDK. I can enter the login information in the dialog window and then select the camera with my mouse. All that works well. Now I would like to do that programmatically. Is that possible?

Thanks

An example is shown in the Cameara Stream Resolution sample.

Thanks!