Scan a Google Cloud Platform (GCP) Storage File for Viruses in C#

Install-Package Cloudmersive.APIClient.NET.VirusScan -Version 3.0.3
using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.VirusScan.Api;
using Cloudmersive.APIClient.NET.VirusScan.Client;
using Cloudmersive.APIClient.NET.VirusScan.Model;
namespace Example
public class ScanCloudStorageScanGcpStorageFileExample
public void main()
// Configure API key authorization: Apikey
Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");
var apiInstance = new ScanCloudStorageApi();
var bucketName = bucketName_example; // string | Name of the bucket in Google Cloud Storage
var objectName = objectName_example; // string | Name of the object or file in Google Cloud Storage
var jsonCredentialFile = new System.IO.FileStream("C:\\temp\\inputfile", System.IO.FileMode.Open); // System.IO.Stream | Service Account credential for Google Cloud stored in a JSON file.
// Scan an Google Cloud Platform (GCP) Storage file for viruses
CloudStorageVirusScanResult result = apiInstance.ScanCloudStorageScanGcpStorageFile(bucketName, objectName, jsonCredentialFile);
catch (Exception e)
Debug.Print("Exception when calling ScanCloudStorageApi.ScanCloudStorageScanGcpStorageFile: " + e.Message );




There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

VR Gameplay — Sentiment Analysis: Part 3

Estimating depth for YOLOv5 object detection bounding boxes using Intel® RealSense™ Depth Camera…

Deep Dive on Stored Procedures with MySQL Database

3 Pathlib Examples for Navigating Folders and Files with Python

i18n-ready LaTex development environment

My First Flutter App On PlayStore

What is Google Kickstart?

How to Validate a First Name in PHP

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

ngrok — Make full use of free tier version to expose your localhost to the internet

How to Set-up Airflow Environment Using Docker

Convert Office Word Documents (DOCX) to Text in C#

A Gentle Introduction to dbatools Commands