Good time of day for all!
I have some troubles, and i hope you guys can help me. I search google, but did not find valid answer for my question.
I want to open alternate file streams. If i write something like
File.Open("filename:stramname")
I receive expetion. It says, that file path in this format is not supported in .NET.
Good, i found very simple solution, using CreateFile API and contructor in IO.FileStream class, that receive windows file handle.
But.
I have to use this code in ASP.NET pages, located in the remote server. And, it seems to me, hosting's security policies forbids applications to use Windows API.
Anyway, i recieve <access denided> error, when use any Windows API on the ASP.NET pages, located on the hosting. I do not receive this errors on same code, if it executes on my local machine.
So, i want to ask you: How can i open Stream object for the alternate file stream, without using Windows API?
|
Go4Expert Founder
|
![]() |
| 11Jul2007,19:05 | #2 |
|
filename:stramname should be a path/
|
|
Light Poster
|
|
| 11Jul2007,22:40 | #3 |
|
Wonderfull, but it does not work.
I wrote: Quote:
|
|
Go4Expert Founder
|
![]() |
| 12Jul2007,09:01 | #4 |
|
Write it as File.Open(@"c:\temp.ext") where temp.ext is the actual file path.
|
|
Light Poster
|
|
| 12Jul2007,12:28 | #5 |
|
Oh, you really do not understand me.
Ok, i ask question in another words. I have stream C:\XXX:ddd Can you write me there really working code, that opens this strram and reads all of data into string variable? |
|
Go4Expert Founder
|
![]() |
| 12Jul2007,14:23 | #6 |
|
Code:
// create reader & open file Textreader tr = new StreamReader(@"C:\123.log"); // read a line of text Console.WriteLine(tr.ReadLine()); // close the stream tr.Close(); |
|
Light Poster
|
|
| 12Jul2007,15:24 | #7 |
|
This code reads main stream of file C:\123.log
I asked you, how to read file stream C:\XXX:ddd Can i give me this code, please? |
|
Go4Expert Founder
|
![]() |
| 12Jul2007,18:01 | #8 |
|
You cannot have a file in windows which has : in its name.
|
|
Light Poster
|
|
| 12Jul2007,18:40 | #9 |
|
It is not file. This is alternate file stream(NTFS-stream).
So, i ask how to work with it |
|
Go4Expert Member
|
|
| 24Jul2007,18:30 | #10 |
|
What you are trying to do requires a seperate class library. Please see this article:
http://www.codeproject.com/cs/files/ads.asp |

