Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Net;
using System.IO;
namespace DistantVacantGovUz
{
public class NetHttpRequests : IHttpRequests
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Net;
using System.IO;
namespace DistantVacantGovUz
{
public class NetHttpRequests : IHttpRequests
public byte[] GetBytesEx(string requestUrl, RequestMethod requestMethod = RequestMethod.GET, string requestData = "")
{
WebClient client = new WebClient();
if (proxy != null)
{
client.Proxy = proxy;
}
client.Headers[HttpRequestHeader.Cookie] = cookies.GetCookieHeader(new Uri(requestUrl));
public byte[] GetBytes(string requestUrl, RequestMethod requestMethod = RequestMethod.GET, string requestData = "")
{
HttpWebRequest request = null;
try
{
request = (HttpWebRequest)WebRequest.Create(requestUrl);
}
catch (Exception ex)
{
at System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request)
at System.Net.WebClient.UploadData(Uri address, String method, Byte[] data)
at System.Net.WebClient.UploadData(String address, String method, Byte[] data)
at DistantVacantGovUz.NetHttpRequests.GetBytesEx(String requestUrl, RequestMethod requestMethod, String requestData) in D:\git\DistantVacantGovUz\DistantVacantGovUz\NetHttpRequests.cs:line 184
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
//using System.Linq;
using System.Text;
using System.Windows.Forms;
//using System.Data.OracleClient;
using Oracle.ManagedDataAccess.Client;
import java.util.Scanner;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
private string [] getFilteredFiles(string [] fileNameFilters)
{
if (fileNameFilters != null && fileNameFilters.Length > 0)
{
List<string> fileNameList = new List<string>();
foreach (string filter in fileNameFilters)
{
string [] files = System.IO.Directory.GetFiles(Environment.SpecialFolder.Desktop.ToString(), filter);
@shmutalov
shmutalov / gist:0502321bcfc30d5182e9
Last active August 29, 2015 14:21
Try to programmaticaly log in to oracle apex application
public void Login()
{
HttpWebRequest r = WebRequest.CreateDefault(new Uri("https://apex.oracle.com/pls/apex/wwv_flow.show?p_flow_id=22337&p_flow_step_id=101&x01=test&x02=test&p_request=APPLICATION_PROCESS=AJAX_LOGIN")) as HttpWebRequest;
if (r != null)
{
r.AllowAutoRedirect = true;
r.CookieContainer = new CookieContainer();
r.KeepAlive = true;
r.UseDefaultCredentials = true;
/*
* The contents of this file are subject to the MonetDB Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.monetdb.org/Legal/MonetDBLicense
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.