ApplicationDeployment.IsFileGroupDownloaded メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ApplicationDeployment.IsFileGroupDownloaded メソッドの意味・解説 

ApplicationDeployment.IsFileGroupDownloaded メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

クライアント コンピュータに、名前付ファイル グループが既にダウンロードされているかどうかチェックします

名前空間: System.Deployment.Application
アセンブリ: System.Deployment (system.deployment.dll 内)
構文構文

Public Function IsFileGroupDownloaded ( _
    groupName As String _
) As Boolean
Dim instance As ApplicationDeployment
Dim groupName As String
Dim returnValue As Boolean

returnValue = instance.IsFileGroupDownloaded(groupName)
public bool IsFileGroupDownloaded (
    string groupName
)
public:
bool IsFileGroupDownloaded (
    String^ groupName
)
public boolean IsFileGroupDownloaded (
    String groupName
)
public function IsFileGroupDownloaded (
    groupName : String
) : boolean

パラメータ

groupName

ダウンロードするファイルの名前付グループClickOnce アプリケーションで "optional" としてマークされすべてのファイルには、グループ名が必要です。

戻り値
このアプリケーション現在のバージョンに対してファイル グループが既にダウンロードされている場合trueそれ以外場合falseアプリケーション新しバージョンインストールされており、その新しバージョンファイル グループ内のファイルに対して追加削除、または変更が行われていない場合IsFileGroupDownloadedtrue返します

例外例外
例外種類条件

InvalidDeploymentException

groupName は、アプリケーション マニフェスト定義されているファイル グループではありません。

解説解説
使用例使用例

HelpFiles グループ内のすべてのファイルディスクダウンロードするコード例次に示します

Dim WithEvents ADDownloadHelpFiles As
 ApplicationDeployment

Private Sub DownloadHelpFiles(ByVal
 GroupName As String)
    If (ApplicationDeployment.IsNetworkDeployed) Then
        ADDownloadHelpFiles = ApplicationDeployment.CurrentDeployment

        If ADDownloadHelpFiles.IsFirstRun Then
            Try
                If ADDownloadHelpFiles.IsFileGroupDownloaded(GroupName)
 Then
                    ADDownloadHelpFiles.DownloadFileGroupAsync(GroupName)
                End If
            Catch ioe As InvalidOperationException
                MessageBox.Show("This application is not a ClickOnce
 application.")
                Return
            End Try
        End If
    End If
End Sub

Sub ADDownloadHelpFiles_DownloadFileGroupProgressChanged(ByVal
 sender As Object, ByVal
 e As DeploymentProgressChangedEventArgs) Handles ADDownloadHelpFiles.DownloadFileGroupProgressChanged
    DownloadStatus.Text = String.Format("Downloading
 file group {0}; {1:D}K of {2:D}K completed.", e.Group, e.BytesCompleted
 / 1024, e.BytesTotal / 1024)
End Sub

Sub ADDownloadHelpFiles_DownloadFileGroupCompleted(ByVal
 sender As Object, ByVal
 e As DownloadFileGroupCompletedEventArgs) Handles ADDownloadHelpFiles.DownloadFileGroupCompleted
    DownloadStatus.Text = String.Format("Download
 of file group {0} complete.", e.Group)
End Sub
private void DownloadFileGroupAsync(string
 fileGroup)
{
    if (ApplicationDeployment.IsNetworkDeployed)
    {
        ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment;

        try
        {
            if (deployment.IsFileGroupDownloaded(fileGroup))
            {
                deployment.DownloadFileGroupProgressChanged += new
 DeploymentProgressChangedEventHandler(deployment_DownloadFileGroupProgressChanged);
                deployment.DownloadFileGroupCompleted += new DownloadFileGroupCompletedEventHandler(deployment_DownloadFileGroupCompleted);

                deployment.DownloadFileGroupAsync(fileGroup);
            }
        }
        catch (InvalidOperationException ioe)
        {
            MessageBox.Show("This application is not a ClickOnce application.
 Error: " + ioe.Message);
            return;
        }
    }
}

void deployment_DownloadFileGroupProgressChanged(object sender,
 DeploymentProgressChangedEventArgs e)
{
    downloadStatus.Text = String.Format("Downloading file group {0}; {1:D}K
 of {2:D}K completed.", e.Group, e.BytesCompleted / 1024, e.BytesTotal / 1024);
               
}

void deployment_DownloadFileGroupCompleted(object sender, DownloadFileGroupCompletedEventArgs
 e)
{
    if (e.Error != null)
    {
        downloadStatus.Text = "Could not download files. Will try
 again later.";
        return;
    }
    else if (e.Cancelled)
    {
        downloadStatus.Text = "The file download has been cancelled.";
        return;
    }

    downloadStatus.Text = String.Format("Download of file group {0} complete.",
 e.Group);
}
void LaunchAppUpdate()
{
    if (ApplicationDeployment::IsNetworkDeployed)
    {
        ApplicationDeployment^ ad =
            ApplicationDeployment::CurrentDeployment;
        ad->UpdateCompleted +=
            gcnew AsyncCompletedEventHandler(this,
            &Form1::LaunchAppUpdate_UpdateCompleted);

        ad->UpdateAsync();
    }
}

void LaunchAppUpdate_UpdateCompleted(Object^ sender,
    AsyncCompletedEventArgs^ e)
{
    if (!e->Cancelled)
    {
        if (nullptr != e->Error)
        {
            System::Windows::Forms::DialogResult dr =
                MessageBox::Show(
                "The application has been updated. Restart?",
                "Restart Application",
                MessageBoxButtons::OKCancel);
            if (System::Windows::Forms::DialogResult::OK == dr)
            {
                Application::Restart();
            }
        }
        else
        {
            // Replace with your own error reporting or logging.
            MessageBox::Show(
                "The application encountered an error in
 " +
                "downloading the latest update. Error: {0}",
                e->Error->Message);
        }
    }
    else
    {
        // Replace with your own error reporting or logging.
        MessageBox::Show(
            "The update of the application's latest version was " +
            "cancelled.");
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ApplicationDeployment クラス
ApplicationDeployment メンバ
System.Deployment.Application 名前空間
DownloadFileGroup
DownloadFileGroupAsync


このページでは「.NET Framework クラス ライブラリ リファレンス」からApplicationDeployment.IsFileGroupDownloaded メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からApplicationDeployment.IsFileGroupDownloaded メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からApplicationDeployment.IsFileGroupDownloaded メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ApplicationDeployment.IsFileGroupDownloaded メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ApplicationDeployment.IsFileGroupDownloaded メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS