¡@

Home 

c# Programming Glossary: sr

How to submit http form using C#

http://stackoverflow.com/questions/1273998/how-to-submit-http-form-using-c-sharp

HttpWebResponse objRequest.GetResponse using StreamReader sr new StreamReader objResponse.GetResponseStream result sr.ReadToEnd.. sr new StreamReader objResponse.GetResponseStream result sr.ReadToEnd Close and clean up the StreamReader sr.Close return..

C# - Exception messages in English?

http://stackoverflow.com/questions/209133/c-sharp-exception-messages-in-english

any side effects. For example try System.IO.StreamReader sr new System.IO.StreamReader @ c does not exist catch Exception..

Reading large text files with streams in C#

http://stackoverflow.com/questions/2161895/reading-large-text-files-with-streams-in-c-sharp

BufferedStream bs new BufferedStream fs using StreamReader sr new StreamReader bs string line while line sr.ReadLine null.. StreamReader sr new StreamReader bs string line while line sr.ReadLine null March 2013 UPDATE I recently wrote code for reading..

How do you programmatically fill in a form and 'POST' a web page?

http://stackoverflow.com/questions/26857/how-do-you-programmatically-fill-in-a-form-and-post-a-web-page

sout.Close WebResponse res req.GetResponse StreamReader sr new StreamReader res.GetResponseStream string returnvalue sr.ReadToEnd..

How do you convert Byte Array to Hexadecimal String, and vice versa?

http://stackoverflow.com/questions/311165/how-do-you-convert-byte-array-to-hexadecimal-string-and-vice-versa

hex.Length 2 byte bytes new byte NumberChars using var sr new StringReader hex for int i 0 i NumberChars i bytes i Convert.ToByte.. i bytes i Convert.ToByte new string new char 2 char sr.Read char sr.Read 16 return bytes share improve this answer..

How to post an array of complex objects with JSON, jQuery to ASP.NET MVC Controller?

http://stackoverflow.com/questions/320291/how-to-post-an-array-of-complex-objects-with-json-jquery-to-asp-net-mvc-control

application json string inputContent using var sr new StreamReader filterContext.HttpContext.Request.InputStream.. inputContent sr.ReadToEnd var result JsonConvert.DeserializeObject inputContent..

Linq to XML - update/alter the nodes of an XML Document

http://stackoverflow.com/questions/331502/linq-to-xml-update-alter-the-nodes-of-an-xml-document

Info' record id '3' info 'sample Info' data StringReader sr new StringReader xml XDocument d XDocument.Load sr d.Descendants.. sr new StringReader xml XDocument d XDocument.Load sr d.Descendants record .Where x x.Attribute id .Value 2 .Single..

how to change originating IP in HttpWebRequest

http://stackoverflow.com/questions/3345387/how-to-change-originating-ip-in-httpwebrequest

response request.GetResponse StreamReader sr new StreamReader response.GetResponseStream return sr.ReadToEnd.. sr new StreamReader response.GetResponseStream return sr.ReadToEnd c# httpwebrequest ip webrequest share improve..

Reading csv file

http://stackoverflow.com/questions/3507498/reading-csv-file

another grid. I'm trying to do that like this StreamReader sr new StreamReader FilePath importingData new Account string line.. new Account string line string row new string 5 while line sr.ReadLine null row line.Split ' ' importingData.Add new Transaction..

How do I save a stream to a file?

http://stackoverflow.com/questions/411592/how-do-i-save-a-stream-to-a-file

may be a .gif or .jpg or .pdf . Existing Code StreamReader sr new StreamReader myOtherObject.InputStream I need to save this..

How to read a large (1 GB) txt file in .NET?

http://stackoverflow.com/questions/4273699/how-to-read-a-large-1-gb-txt-file-in-net

if string.IsNullOrEmpty filePath using StreamReader sr new StreamReader filePath String line while line sr.ReadLine.. sr new StreamReader filePath String line while line sr.ReadLine null FormatData line In FormatData I check the..

Collection was modified; enumeration operation may not execute

http://stackoverflow.com/questions/604831/collection-was-modified-enumeration-operation-may-not-execute

Guid Subscriber public void NotifySubscribers DataRecord sr foreach Subscriber s in subscribers.Values try s.Callback.SignalData.. s in subscribers.Values try s.Callback.SignalData sr catch Exception e DCS.WriteToApplicationLog e.Message System.Diagnostics.EventLogEntryType.Error..

How to both Read/Write File in C#

http://stackoverflow.com/questions/605685/how-to-both-read-write-file-in-c-sharp

doesn't work. static void Main string args StreamReader sr new StreamReader @ C words.txt StreamWriter sw new StreamWriter..

File access error with FileSystemWatcher when multiple files are added to a directory

http://stackoverflow.com/questions/699538/file-access-error-with-filesystemwatcher-when-multiple-files-are-added-to-a-dire

FileAccess.Read FileShare.None using StreamReader sr new StreamReader fs while sr.EndOfStream false line sr.ReadLine.. using StreamReader sr new StreamReader fs while sr.EndOfStream false line sr.ReadLine parse the line and insert.. sr new StreamReader fs while sr.EndOfStream false line sr.ReadLine parse the line and insert into the database catch..

Compression/Decompression string with C#

http://stackoverflow.com/questions/7343465/compression-decompression-string-with-c-sharp

byteArray System.IO.Compression.GZipStream sr new System.IO.Compression.GZipStream ms System.IO.Compression.CompressionMode.Decompress.. byteArray new byte byteArray.Length Decompress int rByte sr.Read byteArray 0 byteArray.Length Transform byte unzip data.. for int i 0 i rByte i sB.Append char byteArray i sr.Close ms.Close sr.Dispose ms.Dispose return sB.ToString..

C# - HttpWebRequest POST (Login to Facebook)

http://stackoverflow.com/questions/8425593/c-sharp-httpwebrequest-post-login-to-facebook

HttpWebResponse getRequest.GetResponse using StreamReader sr new StreamReader getResponse.GetResponseStream string sourceCode.. getResponse.GetResponseStream string sourceCode sr.ReadToEnd This is one of lots ways that works with HttpWebRequest..

C# Login to Website via program

http://stackoverflow.com/questions/930807/c-sharp-login-to-website-via-program

getResponse getRequest.GetResponse using StreamReader sr new StreamReader getResponse.GetResponseStream pageSource sr.ReadToEnd.. new StreamReader getResponse.GetResponseStream pageSource sr.ReadToEnd EDIT If you need to view the results of the first.. can recover the HTML it returned with using StreamReader sr new StreamReader resp.GetResponseStream pageSource sr.ReadToEnd..