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.
Byusingasynchronoussocketsaservercanlisteningforincomingconnectionsanddosomeotherlogicinthe mean time in contrast to synchronous socket when they are listening they block the main…
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 };…
path filter The directory to monitor, in standard or Universal Thetypeoffilestowatch.Forexample,"*.txt"watches for Naming Convention (UNC) notation.…
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…
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())) {…
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))…