Здравствуйте, Curufinwe, Вы писали:
Я долго мучался со всякими Ipc и в результате у меня получился подобный smippet
private static bool InitIpcChannel()
{
SecurityIdentifier Sid = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
NTAccount Account = (NTAccount)Sid.Translate(typeof(NTAccount));
BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider();
serverProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
BinaryClientFormatterSinkProvider clientProv = new BinaryClientFormatterSinkProvider();
//clientProv.
IDictionary properties = new Hashtable();
properties["name"] = "ipc";
properties["priority"] = "20";
properties["portName"] = "Lalalalala");
properties["authorizedGroup"] = Account.Value;
try
{
iChannel = new IpcChannel(properties, clientProv, serverProv);
ChannelServices.RegisterChannel(iChannel, false);
}
catch
{
Log.Write("Cannot register IPC chanel");
return false;
}
return true;
}