network Pipes

  • Thread starter Thread starter Lou
  • Start date Start date
L

Lou

I have a handle to a pipe, but the FileSystem object won't take an int in
the constructor? How do I write to the pipe using the FileSystemObject?

here is my code but the FileStream Line fails?????
I do get a legimate pipe handle.

int pipeHandle;
pipeHandle = CreateFile(connectionString,

GENERIC_READ | GENERIC_WRITE, 0, 0,

OPEN_EXISTING, 0, 0);

//FileStream myStream=new
FileStream(pipeHandle,FileAccess.ReadWrite,true,4095,false);

FileStream sw=new FileStream(pipeHandle,FileAccess.ReadWrite);

sw.Write(cmd);
 
Lou said:
I have a handle to a pipe, but the FileSystem object won't take an int in
the constructor? How do I write to the pipe using the FileSystemObject?

here is my code but the FileStream Line fails?????
I do get a legimate pipe handle.

int pipeHandle;
pipeHandle = CreateFile(connectionString,

GENERIC_READ | GENERIC_WRITE, 0, 0,

OPEN_EXISTING, 0, 0);

//FileStream myStream=new
FileStream(pipeHandle,FileAccess.ReadWrite,true,4095,false);

FileStream sw=new FileStream(pipeHandle,FileAccess.ReadWrite);


The FileStream constructor takes an IntPtr, not an int.

SB

FileStream sw = new FileStream( new
IntPtr(pipeHandle),FileAccess.ReadWrite);

David
 
Back
Top