This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Declare PtrSafe Function CertOpenStore Lib "Crypt32.dll" ( _ | |
ByVal lpszStoreProvider As String, _ | |
ByVal dwEncodingType As Long, _ | |
ByVal hCryptProv As LongPtr, _ | |
ByVal dwFlags As Long, _ | |
ByVal pvPara As LongPtr) As LongPtr | |
Private Declare PtrSafe Function CertCloseStore Lib "Crypt32.dll" ( _ | |
ByVal hCertStore As LongPtr, _ | |
ByVal dwFlags As Long) As Long |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Diagnostics; | |
using System.Drawing; | |
using System.Linq; | |
using System.Net; | |
using System.Net.NetworkInformation; | |
using System.Runtime.InteropServices; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Result<T> | |
{ | |
public T Value { get; } | |
public string Error { get; } | |
public bool IsSuccess => Error == null; | |
private Result(T value, string error) | |
{ | |
Value = value; | |
Error = error; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub RequisicaoWinHTTP() | |
' Cria o objeto WinHttpRequest | |
Dim http As Object | |
Set http = CreateObject("WinHttp.WinHttpRequest.5.1") | |
' URL de destino | |
Dim url As String | |
url = "https://jsonplaceholder.typicode.com/posts/1" | |
On Error GoTo ErroHandler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub RequisicaoHTTPUsandoProxyAutomatico() | |
Dim HTTP As Object | |
Dim URL As String | |
Dim Resultado As String | |
' URL para teste | |
URL = "http://www.google.com" | |
' Criação do objeto ServerXMLHTTP | |
Set HTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub MostrarConfiguracoesProxy() | |
Dim WinHttpReq As Object | |
Dim ProxyConfig As String | |
' Cria um objeto WinHTTP | |
Set WinHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1") | |
' Recupera as configurações de proxy do sistema | |
On Error Resume Next | |
WinHttpReq.SetProxy 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub getPeople() | |
Dim req As MSXML2.ServerXMLHTTP60 | |
Dim Parsed As Dictionary | |
Dim i As Integer | |
Dim Results As Collection | |
Dim Value As Dictionary | |
Set req = New MSXML2.ServerXMLHTTP60 | |
api_url = "https://swapi.dev/api/people/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use MyDb | |
GO | |
DROP TABLE IF EXISTS Tb_Funcionario | |
CREATE TABLE Tb_Funcionario | |
( | |
Id INT NOT NULL, | |
Nome VARCHAR(200), | |
DataNascimento DATE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF OBJECT_ID('tempdb..#Tb_Pessoa') IS NOT NULL | |
DROP TABLE #Tb_Pessoa | |
CREATE TABLE #Tb_Pessoa | |
( | |
Id INT, | |
Nome VARCHAR(100), | |
Estado VARCHAR(100) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF OBJECT_ID('tempdb..#Personagens') IS NOT NULL DROP TABLE #Personagens | |
GO | |
CREATE TABLE #Personagens( | |
Id INT IDENTITY, | |
Nome VARCHAR(100), | |
Funcao VARCHAR(100) | |
) |