OUR BLOG

Company News and Updates

Every week we share out expertise on effective strategies and technics to help you reach customers and prospects across the entire web.

Chapter103:AsynchronousSocket

Byusingasynchronoussocketsaservercanlisteningforincomingconnectionsanddosomeotherlogicinthe mean time in contrast to synchronous socket when they are listening they block the main…
Learn More

Chapter102:Accessnetworksharedfolder withusernameandpassword

AccessingnetworksharefileusingPInvoke. Section102.1:Codetoaccessnetworksharedfile publicclassNetworkConnection:IDisposable { string_networkName; publicNetworkConnection(stringnetworkName, NetworkCredentialcredentials) { _networkName=networkName; varnetResource=newNetResource() { Scope=ResourceScope.GlobalNetwork, ResourceType=ResourceType.Disk, DisplayType=ResourceDisplaytype.Share,RemoteNa me=networkName };…
Learn More

Chapter101:FileSystemWatcher

path                                                                                 filter The directory to monitor, in standard or Universal Thetypeoffilestowatch.Forexample,"*.txt"watches for Naming Convention (UNC) notation.…
Learn More

Chapter100:Readingandwriting.zipfiles

Parameter                                                                          Details archiveFileName Thepathtothearchivetoopen,specifiedasarelativeorabsolutepath.Arelativepathis interpreted as relative to the current working directory. Section100.1:Writingtoazipfile Towriteanew.zipfile: System.IO.Compression System.IO.Compression.FileSystem…
Learn More

Chapter99: PerformingHTTP requests

Section99.1:CreatingandsendinganHTTPPOSTrequest usingSystem.Net; usingSystem.IO; ... stringrequestUrl="https://www.example.com/submit.html"; HttpWebRequestrequest=HttpWebRequest.CreateHttp(requestUrl); request.Method="POST"; //Optionally,setpropertiesoftheHttpWebRequest,suchas:request.AutomaticDecompression=DecompressionMethods.Deflate|DecompressionMethods.GZip; request.ContentType="application/x-www-form-urlencoded"; //CouldalsosetotherHTTPheaderssuchasRequest.UserAgent,Request.Referer, //Request.Accept,orotherheadersviatheRequest.Headerscollection. //SetthePOSTrequestbodydata.Inthisexample,thePOSTdataisin //application/x-www-form-urlencodedformat. stringpostData="myparam1=myvalue1&myparam2=myvalue2"; using(varwriter=newStreamWriter(request.GetRequestStream())) {…
Learn More

Chapter98:Networking

Section98.1:BasicTCPCommunicationClient ThiscodeexamplecreatesaTCPclient,sends"HelloWorld"overthesocketconnection,andthenwritestheserver response to the console before closing the connection. //DeclareVariables stringhost="stackoverflow.com"; intport=9999; inttimeout=5000; //CreateTCPclientandconnect using(var_client=newTcpClient(host,port))…
Learn More

Get new blog posts by email: