CSharp/C# >> looking to output the .cs filename in a project to a .txt file

by YWRpd2Vi » Fri, 24 Jun 2005 23:45:02 GMT

I found that if I use system.reflection.assembly I can extract alot of
information about the code I am running, but in a multiple code project, I
would also like the filename of the .cs where the code class or code function
came from.

Where can I find that?

Any help would be highly appreciated.

Thanks in advance.


CSharp/C# >> RE: looking to output the .cs filename in a project to a .txt file

by QnJlbmRhbiBHcmFudA » Sat, 25 Jun 2005 00:02:02 GMT


Once youe built a block of code into MSIL, any semblance of multiple .cs
files is lost. One of the main reasons for multiple .cs files is for you
during development, as it is often more logical to break an application up
into different files.

One option would be to output your textfiles based on the namespace and/or
class of the code you are dealing with, should you be reflecting on a class
named SuperFoo, output it as SuperFoo.txt. Granted it not the most perfect,
it as close as you will get without building in extensive logic whose job
it is is to guess what code might have been in what files and what their
names might have been.

One way to do it though, would be to to do something similar to an example
from http://www.oreilly.com/catalog/progcsharp2/chapter/ch18.html and build a
custom attribute to store such information.

Brendan

Similar Threads

1. output a project txt file to /bin/output/ on build - Visual Studio .Net/VS.net

2. Shortest way in C# Target is: Input.txt --- Calculation --- Output.txt

Hello,

I have a list with 15 and/or n positions.
The goal should be of generating a new list
with the shortest processing sequence.

   Background is:
   I have a drilling table with engines for X Y.
   (x1, y1) (x2, y2) (x3, y3)

How can I make it?

POS   x         y     Input.txt
_________________________
.1..126,13    66,25
.2..266,34    66,25
.3..406,56    66,25
.4..126,13   127,84
.5..266,34   127,84
.6..406,56   127,84
.7...11,45   140,27
.8..151,59   140,27
.9. 291,73   140,27
10.  11,45   201,86
11. 151,59   201,86
12. 291,73   201,86
13.  11,45   263,46
14. 151,59   263,46
15. 291,73   263,46


Target

Class in C#  ---- calulate

   Optimize list
   POS   x         y    Output.txt
   _________________________
   .1..  ?         ?
   .2..
   .3..
   .4..
   .5..
   .6..
   .7..
   .8..
   .9.
   10.
   11.
   12.
   13.
   14.
   15.

Questions:
a) I look for a sample program,
    to send my list.

    -- Translate ---

    Answer: Is the the optmized list.
            Gladly also as text format.
            Someone can help me.
                 Input.txt --- Calculation --- Output.txt
b) Best one should also understand it,
    not only a black box.
    There is a step by step instruction, understandable explanation.

    Thank you.

    Best regards
        Martin

3. Shortest way in C++ Target is: Input.txt --- Calculation --- Output.txt

4. Shortest way in C++ Target is: Input.txt --- Calculation --- Output.txt

Hello,

I have a list with 15 and/or n positions.
The goal should be of generating a new list
with the shortest processing sequence.

   Background is:
   I have a drilling table with engines for X Y.
   (x1, y1) (x2, y2) (x3, y3)

How can I make it?

POS   x         y     Input.txt
_________________________
.1..126,13    66,25
.2..266,34    66,25
.3..406,56    66,25
.4..126,13   127,84
.5..266,34   127,84
.6..406,56   127,84
.7...11,45   140,27
.8..151,59   140,27
.9. 291,73   140,27
10.  11,45   201,86
11. 151,59   201,86
12. 291,73   201,86
13.  11,45   263,46
14. 151,59   263,46
15. 291,73   263,46


Target

Class in C++   ---- calulate

   Optimize list
   POS   x         y    Output.txt
   _________________________
   .1..  ?         ?
   .2..
   .3..
   .4..
   .5..
   .6..
   .7..
   .8..
   .9.
   10.
   11.
   12.
   13.
   14.
   15.

Questions:
a) I look for a sample program,
    to send my list.

    -- Translate ---

    Answer: Is the the optmized list.
            Gladly also as text format.
            Someone can help me.
                 Input.txt --- Calculation --- Output.txt
b) Best one should also understand it,
    not only a black box.
    There is a step by step instruction, understandable explanation.

    Thank you.

    Best regards
        Martin

5. Shortest way in C++ Target is: Input.txt --- Calculation --- Output.txt

6. Taking a single large .cs file and making many smaller .cs files

"Greg Larsen" < XXXX@XXXXX.COM > ha scritto nel messaggio 
news:79450CE7-E6E2-43E8-8FD9-

> If I'm building a class as ABC, and in contains a lot of methods, 
> eventually
> my code file ABC.cs get extremely large, let say 3000+ lines of code. 
> What
> are the best approaches to breaking up my large ABC.cs file into smaller
> manageable chunks, so no code file is larger that say 200-300 lines of 
> code?

best: Restructure the code and using more specific classes.

worse: use the "partial" keyword.



7. how can I add .txt files or .pdf files at runtime in my ASP.NET project - Asp.Net

8. encoding on txt output file!