المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Erro: No overload for method 'GetRegisteredActivatedServiceTypes' takes '3' arguments



C# Programming
10-10-2013, 08:37 AM
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;

using System.Runtime.Remoting.Channels.Tcp;
using Project1;


namespace Server
{
public partial class Form1 : Form
{
private TcpChannel tcpchannel = null;
private int port = 8998;
private Type type;
private WellKnownObjectMode wellknownobj;
private string objURL;



public Form1()
{
InitializeComponent();
}


private void Form1_Load(object sender, EventArgs e)
{

}

private void btnKhoi_Click(object sender, EventArgs e)
{

try {
btnTat.PerformClick();
port = Int32.Parse(txtPort.Text);
tcpchannel = new TcpChannel(port);
ChannelServices.RegisterChannel(tcpchannel,false);
type = typeof(Proxy);
objURL ="Prime_URL";
if(rdb_sTon.Checked==true)
wellknownobj = WellKnownObjectMode.Singleton;



else
wellknownobj = WellKnownObjectMode.SingleCall;
RemotingConfiguration.GetRegisteredActivatedServiceTypes(type,objURL,wellknownobj);//Error this line

txtTrThai.Text="Khoi dong server tai Port"+port.ToString()+"luc"+ DateTime.Now.ToString();
}catch(Exception ex){
MessageBox.Show("Loi", ex.Message);
}

}

private void btnTat_Click(object sender, EventArgs e)
{

if (ChannelServices.GetChannel("tcp") != null) {

ChannelServices.UnregisterChannel(tcpchannel);
txtTrThai.Text = "tat server tai port" + port.ToString() + "luc" + DateTime.Now.ToString();

}


}
}
}