Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
AnswerRe: DataGrid Update Problem Pin
Nader Elshehabi11-Sep-06 7:01
Nader Elshehabi11-Sep-06 7:01 
GeneralRe: DataGrid Update Problem Pin
llap44411-Sep-06 7:26
llap44411-Sep-06 7:26 
GeneralRe: DataGrid Update Problem Pin
Syed Shahid Hussain11-Sep-06 7:40
Syed Shahid Hussain11-Sep-06 7:40 
QuestionHow to change "ReadOnly" value with Controls[] Pin
N3croman11-Sep-06 6:03
N3croman11-Sep-06 6:03 
AnswerRe: How to change "ReadOnly" value with Controls[] Pin
Nader Elshehabi11-Sep-06 6:15
Nader Elshehabi11-Sep-06 6:15 
GeneralRe: How to change "ReadOnly" value with Controls[] Pin
N3croman11-Sep-06 6:23
N3croman11-Sep-06 6:23 
GeneralRe: How to change "ReadOnly" value with Controls[] Pin
Judah Gabriel Himango11-Sep-06 7:09
sponsorJudah Gabriel Himango11-Sep-06 7:09 
Question"This assembly does not allow partially trusted callers" when program executed from network drive Pin
Nigor11-Sep-06 6:01
Nigor11-Sep-06 6:01 
I have a remoting app that works fine when executed from a local hard drive, but will give "This assembly does not allow partially trusted callers" exception when executed from a network drive. The remoting app is used for transfering files. The code for server, shared assembly, and client:

<br />
// Client:<br />
// ---------------------------------------------------------------<br />
<br />
using System;<br />
using System.Collections;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Runtime.Remoting;<br />
using System.Runtime.Remoting.Channels;<br />
using System.Runtime.Remoting.Channels.Http;<br />
using System.IO;<br />
<br />
namespace RemotingTest<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
IDictionary properties = new Hashtable();<br />
<br />
SoapClientFormatterSinkProvider clientSinkProvider = new SoapClientFormatterSinkProvider();<br />
SoapServerFormatterSinkProvider serverSinkProvider = new SoapServerFormatterSinkProvider();<br />
<br />
serverSinkProvider.TypeFilterLevel =<br />
System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;<br />
<br />
properties["name"] = "";<br />
properties["port"] = 0;<br />
properties["typeFilterLevel"] = "Full";<br />
<br />
HttpChannel commChannel = new HttpChannel(properties, clientSinkProvider, serverSinkProvider);<br />
<br />
ChannelServices.RegisterChannel(commChannel, false);<br />
<br />
RemotingConfiguration.RegisterWellKnownClientType(<br />
typeof(ServerInterface),<br />
"http://igor.no-ip.ca:1024/Server"); // change to appropriate address here<br />
<br />
ServerInterface server = new ServerInterface();<br />
<br />
string text = "";<br />
<br />
while((text = Console.ReadLine()) != "Quit")<br />
{<br />
Console.WriteLine(server.ShowText("testing string"));<br />
Console.WriteLine(server.ShowFileInfo(text).Name);<br />
}<br />
<br />
Console.Read();<br />
}<br />
}<br />
}<br />
<br />
<br />
// Server Interface:<br />
// ------------------------------------------------------------<br />
<br />
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.IO;<br />
<br />
namespace RemotingTest<br />
{<br />
public class ServerInterface: MarshalByRefObject<br />
{<br />
public FileInfo ShowFileInfo(string filename)<br />
{<br />
Console.WriteLine("Filename " + filename + " requested");<br />
<br />
return new FileInfo(filename);<br />
}<br />
<br />
public string ShowText(string text)<br />
{<br />
Console.WriteLine(text);<br />
<br />
return "\"" + text + "\" show on the server.";<br />
}<br />
}<br />
}<br />
<br />
<br />
// Server:<br />
// --------------------------------------------------------------------<br />
<br />
<br />
using System;<br />
using System.Collections;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Runtime.Remoting;<br />
using System.Runtime.Remoting.Channels;<br />
using System.Runtime.Remoting.Channels.Http;<br />
<br />
namespace RemotingTest<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
IDictionary properties = new Hashtable();<br />
<br />
SoapServerFormatterSinkProvider serverSinkProvider = new SoapServerFormatterSinkProvider();<br />
<br />
serverSinkProvider.TypeFilterLevel =<br />
System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;<br />
<br />
properties["name"] = "";<br />
properties["port"] = 1024;<br />
properties["typeFilterLevel"] = "Full";<br />
properties["machineName"] = "igor.no-ip.ca"; // THE MAGIC LINE !!!<br />
<br />
HttpChannel commChannel = new HttpChannel(properties, null, serverSinkProvider);<br />
<br />
ChannelServices.RegisterChannel(commChannel, false);<br />
<br />
RemotingConfiguration.RegisterWellKnownServiceType(<br />
typeof(ServerInterface),<br />
"Server", WellKnownObjectMode.SingleCall);<br />
<br />
Console.Read();<br />
}<br />
}<br />
}<br />


Please help.
AnswerRe: "This assembly does not allow partially trusted callers" when program executed from network drive Pin
Judah Gabriel Himango11-Sep-06 7:02
sponsorJudah Gabriel Himango11-Sep-06 7:02 
QuestionGlobally accessible properties Pin
WetRivrRat11-Sep-06 5:47
WetRivrRat11-Sep-06 5:47 
AnswerRe: Globally accessible properties Pin
Bijesh11-Sep-06 6:39
Bijesh11-Sep-06 6:39 
QuestionCompile with specified version of .NET framework Pin
dobrzan11-Sep-06 5:37
dobrzan11-Sep-06 5:37 
AnswerRe: Compile with specified version of .NET framework Pin
Insincere Dave11-Sep-06 6:00
Insincere Dave11-Sep-06 6:00 
AnswerRe: Compile with specified version of .NET framework Pin
WetRivrRat11-Sep-06 6:05
WetRivrRat11-Sep-06 6:05 
QuestionXML reader problem Pin
Scalee11-Sep-06 4:11
Scalee11-Sep-06 4:11 
AnswerRe: XML reader problem Pin
Not Active11-Sep-06 4:35
mentorNot Active11-Sep-06 4:35 
GeneralRe: XML reader problem Pin
Scalee11-Sep-06 5:58
Scalee11-Sep-06 5:58 
GeneralRe: XML reader problem Pin
Not Active11-Sep-06 6:36
mentorNot Active11-Sep-06 6:36 
GeneralRe: XML reader problem Pin
Scalee11-Sep-06 8:06
Scalee11-Sep-06 8:06 
Questionhow to send letters like é § è ç to the serial com port? Pin
faladrim11-Sep-06 3:39
faladrim11-Sep-06 3:39 
AnswerRe: how to send letters like é § è ç to the serial com port? Pin
Nader Elshehabi11-Sep-06 6:09
Nader Elshehabi11-Sep-06 6:09 
GeneralRe: how to send letters like é § è ç to the serial com port? Pin
faladrim11-Sep-06 20:45
faladrim11-Sep-06 20:45 
GeneralRe: how to send letters like é § è ç to the serial com port? Pin
Nader Elshehabi11-Sep-06 21:23
Nader Elshehabi11-Sep-06 21:23 
GeneralRe: how to send letters like é § è ç to the serial com port? Pin
faladrim11-Sep-06 22:04
faladrim11-Sep-06 22:04 
AnswerRe: how to send letters like é § è ç to the serial com port? Pin
Nader Elshehabi12-Sep-06 3:45
Nader Elshehabi12-Sep-06 3:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.