336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

[Server - C#]


using System;

using System.IO;

using System.IO.Pipes;


namespace NamedPipeCs

{

class Program

{

static void Main(string[] args)

{

while (true)

{

using (var server = new NamedPipeServerStream("DavidPipe"))

{

server.WaitForConnection();


using (var reader = new StreamReader(server))

{

string temp;

while ((temp = reader.ReadLine()) != null)

{

Console.WriteLine("{0}", temp);

}

}

}

}

}

}

}


----------------------------------------------------------------------------


[Client - C++]


#include <iostream>

using namespace std;

#include <windows.h>


int main()

{

HANDLE hPipe = CreateFile("\\\\.\\pipe\\DavidPipe", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);

if (hPipe == NULL || hPipe == INVALID_HANDLE_VALUE)

return -1;


LPTSTR lpMessage = TEXT("FUCK THAT SHIT");

DWORD dwNumberOfBytesToWrite = (lstrlen(lpMessage) + 1) * sizeof(TCHAR);

DWORD dwNumberOfBytesWritten;


BOOL bSuccess = WriteFile(hPipe, lpMessage, dwNumberOfBytesToWrite, &dwNumberOfBytesWritten, NULL);

if (bSuccess == FALSE)

return -1;


CloseHandle(hPipe);


return 0;

}

Posted by 역시인생한방
,