InPlaceHostingManager Costruttori
Definizione
Crea una nuova istanza della classe InPlaceHostingManager per scaricare e installare l'applicazione specificata.Creates a new instance of InPlaceHostingManager to download and install the specified application.
Overload
InPlaceHostingManager(Uri) |
Crea una nuova istanza della classe InPlaceHostingManager per scaricare e installare l'applicazione ospitata dal browser specificata.Creates a new instance of InPlaceHostingManager to download and install the specified browser-hosted application. |
InPlaceHostingManager(Uri, Boolean) |
Crea una nuova istanza della classe InPlaceHostingManager per scaricare e installare l'applicazione specificata, che può essere un'applicazione Windows Form autonoma o un'applicazione ospitata in un browser.Creates a new instance of InPlaceHostingManager to download and install the specified application, which can be either a stand-alone Windows Forms-based application or an application hosted in a Web browser. |
InPlaceHostingManager(Uri)
Crea una nuova istanza della classe InPlaceHostingManager per scaricare e installare l'applicazione ospitata dal browser specificata.Creates a new instance of InPlaceHostingManager to download and install the specified browser-hosted application.
public:
InPlaceHostingManager(Uri ^ deploymentManifest);
public InPlaceHostingManager (Uri deploymentManifest);
new System.Deployment.Application.InPlaceHostingManager : Uri -> System.Deployment.Application.InPlaceHostingManager
Public Sub New (deploymentManifest As Uri)
Parametri
- deploymentManifest
- Uri
URI (Uri) del manifesto di distribuzione di un'applicazione ClickOnceClickOnce.A Uniform Resource Identifier (Uri) to a ClickOnceClickOnce application's deployment manifest.
Eccezioni
La classe InPlaceHostingManager può essere utilizzata solo in Windows XP o in versioni più recenti del sistema operativo Windows.InPlaceHostingManager can be used only in Windows XP or in later versions of the Windows operating system.
Non è possibile passare null
come valore dell'argomento deploymentManifest
.Cannot pass null
for the deploymentManifest
argument.
deploymentManifest
utilizza uno schema URI non è supportato da ClickOnceClickOnce.deploymentManifest
uses a URI scheme that is not supported by ClickOnceClickOnce.
Commenti
Questo costruttore viene utilizzato quando si desidera scaricare un'applicazione basata su Windows Presentation Foundation ospitata in una Web browser.This constructor is used when you want to download a Windows Presentation Foundation-based application that is hosted in a Web browser. Per scaricare le applicazioni basate su Windows Forms distribuite mediante ClickOnceClickOnce, utilizzare il InPlaceHostingManager costruttore con il launchInHostProcess
parametro impostato su false
.To download Windows Forms-based applications that are deployed using ClickOnceClickOnce, use the InPlaceHostingManager constructor with the launchInHostProcess
parameter set to false
.
InPlaceHostingManager(Uri, Boolean)
Crea una nuova istanza della classe InPlaceHostingManager per scaricare e installare l'applicazione specificata, che può essere un'applicazione Windows Form autonoma o un'applicazione ospitata in un browser.Creates a new instance of InPlaceHostingManager to download and install the specified application, which can be either a stand-alone Windows Forms-based application or an application hosted in a Web browser.
public:
InPlaceHostingManager(Uri ^ deploymentManifest, bool launchInHostProcess);
public InPlaceHostingManager (Uri deploymentManifest, bool launchInHostProcess);
new System.Deployment.Application.InPlaceHostingManager : Uri * bool -> System.Deployment.Application.InPlaceHostingManager
Public Sub New (deploymentManifest As Uri, launchInHostProcess As Boolean)
Parametri
- deploymentManifest
- Uri
URI (Uniform Resource Identifier) del manifesto di distribuzione dell'applicazione che verrà installata.The Uniform Resource Identifier (URI) to the deployment manifest of the application that will be installed.
- launchInHostProcess
- Boolean
Determina se questa applicazione verrà eseguita in un host, ad esempio un browser.Whether this application will be run in a host, such as a Web browser. Per un'applicazione autonoma, impostare questo valore su false
.For a stand-alone application, set this value to false
.
Eccezioni
La classe InPlaceHostingManager può essere utilizzata solo in Windows XP o in versioni più recenti del sistema operativo Windows.InPlaceHostingManager can be used only in Windows XP or in later versions of the Windows operating system.
Non è possibile passare null
come valore dell'argomento deploymentManifest
.Cannot pass null
for the deploymentManifest
argument.
deploymentManifest
utilizza uno schema URI non è supportato da ClickOnceClickOnce.deploymentManifest
uses a URI scheme that is not supported by ClickOnceClickOnce.
Esempi
Nell'esempio di codice riportato di seguito viene illustrato come creare InPlaceHostingManager un'istanza di che consente di scaricare applicazioni basate su Windows Forms ClickOnceClickOncedistribuite tramite.The following code example demonstrates how to create an instance of InPlaceHostingManager that allows you to download Windows Forms-based applications deployed using ClickOnceClickOnce.
InPlaceHostingManager iphm = null;
public void InstallApplication(string deployManifestUriStr)
{
try
{
Uri deploymentUri = new Uri(deployManifestUriStr);
iphm = new InPlaceHostingManager(deploymentUri, false);
}
catch (UriFormatException uriEx)
{
MessageBox.Show("Cannot install the application: " +
"The deployment manifest URL supplied is not a valid URL. " +
"Error: " + uriEx.Message);
return;
}
catch (PlatformNotSupportedException platformEx)
{
MessageBox.Show("Cannot install the application: " +
"This program requires Windows XP or higher. " +
"Error: " + platformEx.Message);
return;
}
catch (ArgumentException argumentEx)
{
MessageBox.Show("Cannot install the application: " +
"The deployment manifest URL supplied is not a valid URL. " +
"Error: " + argumentEx.Message);
return;
}
iphm.GetManifestCompleted += new EventHandler<GetManifestCompletedEventArgs>(iphm_GetManifestCompleted);
iphm.GetManifestAsync();
}
Dim WithEvents iphm As InPlaceHostingManager = Nothing
Public Sub InstallApplication(ByVal deployManifestUriStr As String)
Try
Dim deploymentUri As New Uri(deployManifestUriStr)
iphm = New InPlaceHostingManager(deploymentUri, False)
MessageBox.Show("Created the object.")
Catch uriEx As UriFormatException
MessageBox.Show("Cannot install the application: " & _
"The deployment manifest URL supplied is not a valid URL." & _
"Error: " & uriEx.Message)
Return
Catch platformEx As PlatformNotSupportedException
MessageBox.Show("Cannot install the application: " & _
"This program requires Windows XP or higher. " & _
"Error: " & platformEx.Message)
Return
Catch argumentEx As ArgumentException
MessageBox.Show("Cannot install the application: " & _
"The deployment manifest URL supplied is not a valid URL." & _
"Error: " & argumentEx.Message)
Return
End Try
iphm.GetManifestAsync()
End Sub