![]() |
How to work with alternate file streams on .NET?
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? |
Re: How to work with alternate file streams on .NET?
filename:stramname should be a path/
|
Re: How to work with alternate file streams on .NET?
Wonderfull, but it does not work.
I wrote: Quote:
|
Re: How to work with alternate file streams on .NET?
Write it as File.Open(@"c:\temp.ext") where temp.ext is the actual file path.
|
Re: How to work with alternate file streams on .NET?
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? |
Re: How to work with alternate file streams on .NET?
Code:
// create reader & open file |
Re: How to work with alternate file streams on .NET?
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? |
Re: How to work with alternate file streams on .NET?
You cannot have a file in windows which has : in its name.
|
Re: How to work with alternate file streams on .NET?
It is not file. This is alternate file stream(NTFS-stream).
So, i ask how to work with it |
Re: How to work with alternate file streams on .NET?
What you are trying to do requires a seperate class library. Please see this article:
http://www.codeproject.com/cs/files/ads.asp |
| All times are GMT +5.5. The time now is 01:23. |