Skip to content

Instantly share code, notes, and snippets.

@AlexP11223
AlexP11223 / Drive.cs
Last active March 29, 2017 18:25
Simple example showing how to load disks information using WMI. C#, .NET
using System;
using System.Collections.Generic;
namespace WindowsFormsApplication19
{
class Drive
{
public string DeviceId { get; set; }
public string Model { get; set; }
/// <summary>
/// WebClient with Cookies support, UserAgent
/// </summary>
public class CookieAwareWebClient : WebClient
{
public CookieContainer CookieContainer { get; } = new CookieContainer();
public string UserAgent { get; set; } = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36";
protected override WebRequest GetWebRequest(Uri address)
using System;
using Awesomium.Core;
namespace WebViewHelpers
{
public static class WebViewExtensions
{
/// <summary>
/// Simulates mouse movement to the specified coordinates and click.
/// As I remember it requires coordinates relative to the currently displayed area, and also will not work if specified coordinates are out of that area.