RemoteAgent.Start Method
Deploys the device agent to the device according to the commands in the package specified by Id.
Namespace: Microsoft.SmartDevice.Connectivity
Assembly: Microsoft.SmartDevice.Connectivity (in Microsoft.SmartDevice.Connectivity.dll)
Syntax
'Declaration
Public Sub Start ( _
arguments As String _
)
'Usage
Dim instance As RemoteAgent
Dim arguments As String
instance.Start(arguments)
public void Start(
string arguments
)
public:
void Start(
String^ arguments
)
public function Start(
arguments : String
)
Parameters
arguments
Type: System.StringCommand-line arguments to be passed when starting the service.
Exceptions
Exception | Condition |
---|---|
SmartDeviceException | Occurs if a COM exception is thrown by underlying COM components |
DeviceNotConnectedException | Occurs if a device is not connected. |
Remarks
When you start the remote agent, the agent finds the package with the same ID and then deploys the agent according to the settings defined in the package. The package tells the remote agent to deploy a device agent that exchanges data with the development computer. For more information, see Overview of Add-on Packages.
If an instance of the agent is already running on the device, the method first stops the agent and then starts it again.
Deployment occurs only if an older version of the agent is present on the device.
Examples
' Copy and start a device agent based on the ID of its add-on package.
Dim ra As RemoteAgent = device.GetRemoteAgent( _
New ObjectId("CAF078AE-2E10-43e2-B566-C4577F2538C7"))
ra.Start("command line argument")
// Copy and start a device agent based on the ID of its add-on package.
RemoteAgent ra = device.GetRemoteAgent(
new ObjectId("CAF078AE-2E10-43e2-B566-C4577F2538C8"));
ra.Start("command line argument");
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.