Skip to main content

All Questions

Tagged with
0 votes
1 answer
92 views

C# Export Logs to 2 txt files

So I have a button made from my xaml file (view), called Export. When the user clicks on it, the logs created during the run of the app get exported to Logs.txt. If there are Warnings, Errors or ...
PinkGoat_'s user avatar
0 votes
1 answer
206 views

C# System.IO : The process cannot access the file path because it is being used by another process

I am trying to debug the code for uploading the .xlsx file through my application in my local system. At the time of appending log data to the log file this exception The process cannot access the ...
Akbar Shaik's user avatar
-1 votes
2 answers
2k views

proper way to use StreamWriter for a log file [closed]

FYI- the original poster cannot use open source or 3rd party libraries. I am creating an application that will use a log file. I want to know what is the "proper" way of creating a log file (...
Yakir Shlezinger's user avatar
1 vote
2 answers
476 views

StreamWriter keeps writing to the same file after instantiating it again for another file

I'm trying to implement a simple file-logger object, with the possibility to truncate the file when its size reaches a threshold. I am using a StreamWriter, which gets written to at each call of the ...
Gabriel Macovei's user avatar
1 vote
1 answer
7k views

C# - Why I get LockRecursionException when using ReaderWriterLockSlim?

I am working on a multi-threaded program. I'm trying to create a simple logging system with two types of logs: 'INFO' and 'ERROR'. I created a class called 'Logger' and two static methods: Info and ...
Ron D's user avatar
  • 33
2 votes
1 answer
68 views

Profling performance of custom logger class, for an application reading Word document

I have an application which reads comments and paragraphs from a .docx file, using OpenXmlPowerTools. It is a console application, and it creates a debug.log file while it is running. There is a ...
Al2110's user avatar
  • 576
2 votes
1 answer
132 views

Is there a PowerShell logging module that uses StreamWriter to write to a text file?

I checked a dozen logging modules published at PowerShellGallery.com but every one of them uses a variation of the Write-Output or piping to Out-File approach which is really inefficient for bigger ...
Alek Davis's user avatar
  • 10.7k
0 votes
0 answers
70 views

Thread logging data to text file - how to?

I tried to build a App that continuously write data in a text file. I done this with a endless Thread (sleep-write data-sleep...). Now I recognized, that the app is not continuously running in ...
Richi's user avatar
  • 23
0 votes
1 answer
63 views

How can I open a Program with a logfil multiple times? (C#)

I have this code: class Program { static void Main(string[] args) { using (StreamWriter w = File.AppendText(@"C:\temp\log.txt")) { Log("Test1", w); ...
Manu's user avatar
  • 83
-1 votes
1 answer
1k views

Creating log file with extension 'log'

I want to create a log file with extension 'log' but a simple text file is created (txt) but when I create a data file with extension 'dat' it works. var ext = ".log"; using (StreamWriter sw = new ...
Sándor Hatvani's user avatar
1 vote
3 answers
11k views

The process cannot access the file 'C:\file.txt' because it is being used by another process

I am trying to log each method on my program, I have the application deployed on IIS Server and the user just called me and said the email functionality is not working so I need to basically run the ...
CodeMan's user avatar
  • 133
0 votes
2 answers
1k views

C# - Is the size of a file have an influence on the write speed?

I have a LogFile which log at a rhythm of (10MB/Hours) and this program need to run for the next 10+ Years. I need to decided at which size I create a new log file ! I have compare the time to write ...
Mr Rubix's user avatar
  • 1,510
2 votes
3 answers
406 views

How can I set StreamWriter's source as multiple in .NET?

I am developing some network program in .NET. I want to see entire text stream on my output window as log. So I tried to search the solution for setting mutiple source on StreamWriter. But I can not ...
Hyundong Hwang's user avatar
0 votes
2 answers
1k views

What will happen if I write a file with StreamWriter to a full hard drive?

I am writing many .csv files to my hard drive to log some measurement data using the StreamWriter and CsvHelper from Josh Close class: using (TextWriter writer = new StreamWriter(path,true)) using (...
Sebastian Richter's user avatar
1 vote
1 answer
1k views

Using StreamWriter in VB.NET won't write to text file

I have read these sources (first Stack Overflow question, second Stack Overflow question, third Stack Overflow question, fourth Stack Overflow question and Microsoft streamwriter) ...
MAC's user avatar
  • 686

15 30 50 per page