Tag: c#
-
RESTSHARP: GET / POST/ DOWNLOAD and UPLOAD with and without Authentication
//GET: var client = new RestClient(“http://www.example.com/”); client.Authenticator = new HttpBasicAuthenticator(“username”, “password”); var request = new RestRequest(URI, Method.GET); request.AddQueryParameter(“id”, customid); var queryResult = client.Execute(request).Content; //POST: var client = new RestClient(“http://www.example.com/”); client.Authenticator = new HttpBasicAuthenticator(“username”, “password”); var request = new RestRequest(URI, Method.POST); request.RequestFormat = DataFormat.Json; request.AddQueryParameter(“id”, customid); request.AddBody(Parameters); IRestResponse response = client.Execute(request); //DOWNLOAD FILE: var client =…
-
How to read DBF to Datatable
[csharp] OleDbConnection oConn = new OleDbConnection(@”Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Temp;Extended Properties=dBase III”); OleDbCommand command = new OleDbCommand(“SELECT * FROM Test.DBF”, oConn); oConn.Open(); DataTable dt = new DataTable(); dt.Load(command.ExecuteReader()); oConn.Close(); [/csharp]