Showing posts with label .NET4.6.1. Show all posts
Showing posts with label .NET4.6.1. Show all posts

Saturday, August 22, 2020

MD5HashChanger ( multiple subfolder, Files, Folders etc )

MD5HashChanger ( multiple subfolder etc ) 

- change md5 files, 

- support multiple files and folders.

- support  drag and drop folder ( not files ) 

Taken from https://github.com/ewwink/MD5-Hash-Changer

and changed with more options for myself

v1.2

http://www.mediafire.com/file/g67g2vg6k8igqci/MD5HashChanger_v1.2.zip/file

 

v1.3

- Multiple files and Multiple Folder, drag and drop 

https://www.mediafire.com/file/cwpb4xrjsg96zkt/MD5HashChanger_v1.3.zip/file




Thursday, April 9, 2020

Async Await Non BLocking UI from OLD HTTPWEBREQUEST

 


 

Taken from https://stackoverflow.com/questions/14577346/converting-ordinary-http-post-web-request-with-async-and-await

from answer https://stackoverflow.com/a/14711326 

There 4 await, even StreamReader WILL BLOCK your UI ( Gw baru tahu disini, ketika koneksi DOWN and SLOW . Internet Provider in village is sucks ) & GetRequestStreamAsync is must




public async Task GetEnvironmentVariablesAsync(Action<Credentials> getResultCallback, Action<Exception> getErrorCallback)
{
    CredentialsCallback = getResultCallback;
    ErrorCallback = getErrorCallback;
    var uri = new Uri(BaseUri);
    var request = (HttpWebRequest) WebRequest.Create(uri);
    request.Method = "POST";
    request.ContentType = "application/json";
    var jsonObject = new JObject
    {
        new JProperty("apiKey",_api),
        new JProperty("affiliateId",_affid),
    };
    var serializedResult = JsonConvert.SerializeObject(jsonObject);
    byte[] requestBody = Encoding.UTF8.GetBytes(serializedResult);

    // ASYNC: using awaitable wrapper to get request stream
    using (var postStream = await request.GetRequestStreamAsync())
    {
        // Write to the request stream.
        // ASYNC: writing to the POST stream can be slow
        await postStream.WriteAsync(requestBody, 0, requestBody.Length);
    }

    try
    {
        // ASYNC: using awaitable wrapper to get response
        var response = (HttpWebResponse) await request.GetResponseAsync();
        if (response != null)
        {
            var reader = new StreamReader(response.GetResponseStream());
            // ASYNC: using StreamReader's async method to read to end, in case
            // the stream i slarge.
            string responseString = await reader.ReadToEndAsync();
            Credentails = JsonConvert.DeserializeObject<Credentials>(responseString);
            if (Credentails != null && string.IsNullOrEmpty(Credentails.Err))
                CredentialsCallback(Credentails);
            else
            {
                if (Credentails != null)
                    ErrorCallback(new Exception(string.Format("Error Code : {0}", StorageCredentails.Err)));
            }
        }
    }
    catch (WebException we)
    {
        var reader = new StreamReader(we.Response.GetResponseStream());
        string responseString = reader.ReadToEnd();
        Debug.WriteLine(responseString);
        ErrorCallback(we);

    }
}


This is MY OWN IMPLEMENTATION



private async Task<string> REQUESTBLOCK( string blogid, string bearer)
{

string responseresult = string.Empty;

try
{



 HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https:/website/");

 request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0";
 request.Accept = "*/*";
 request.Headers.Set(HttpRequestHeader.AcceptLanguage, "en-US,en;q=0.5");
 request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br");
 request.Referer = "https:/website/" + blogid + "/write/new";
 request.ContentType = "application/json";
 request.Headers.Set(HttpRequestHeader.Authorization, bearer);
 request.Headers.Add("X-Client-Release", @"RELEASE");
 request.Headers.Add("X-Client-Request-Id", @"IDCLIENT");
 request.Headers.Add("Origin", @"https:/website/");
 request.KeepAlive = true;

 request.Method = "POST";
 request.ServicePoint.Expect100Continue = false;


 string body = @"DISINIJSON";
 byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
 request.ContentLength = postBytes.Length;
 Stream stream = await request.GetRequestStreamAsync();
 stream.Write(postBytes, 0, postBytes.Length);
 stream.Close();

 using (var response = await request.GetResponseAsync())
 {
  using (Stream dataStream = response.GetResponseStream())
  {
   // Open the stream using a StreamReader for easy access.  
   StreamReader reader = new StreamReader(dataStream);
   // Read the content.  
   string responseFromServer = await reader.ReadToEndAsync();
   // Display the content.  
   //Console.WriteLine(responseFromServer);

   responseresult = responseFromServer;
   //Console.WriteLine(dataurl);
  }

 }

}  
 catch  /*(WebException e) */
 {

 }

}

Thursday, February 6, 2020

Scraper MOVIE AND TV, from TMDB , Scraper TMDB #scaper



 


This is Scraper TMDB movie and TV, But for now this is scraper only for movie. TMDB is like IMDB alternatif sites, but build by community and for community.

TMDB is
The Movie Database (TMDb) is a community built movie and TV database. Every piece of data has been added by our amazing community dating back to 2008. TMDb's strong international focus and breadth of data is largely unmatched and something we're incredibly proud of. Put simply, we live and breathe community and that's precisely what makes us different.

In this Scraper TMDB you get data as : MOVIE ID (TMDB ID), LINK OF MOVIE, TITLE, OVERVIEW, IMAGE PATH (POSTER) of MOVIE

The Result is on CSV files. And I enforcing limit about 30 seconds until 60 seconds.

Join and ask in our FB GROUP

SCREENSHOT










SCRAPER TMDB v1.0

https://www.mediafire.com/file/wb6faapdrxrqpev/Scraper_TMDB_v1.0.zip/file

https://www.mediafire.com/file/wb6faapdrxrqpev/Scraper_TMDB_v1.0.zip/file
https://www.mediafire.com/file/wb6faapdrxrqpev/Scraper_TMDB_v1.0.zip/file