|
My server is:
public static void Main()
{
HttpServerChannel channel = new HttpServerChannel(9000);
ChannelServices.RegisterChannel(channel,false);
WellKnownServiceTypeEntry remObj = new WellKnownServiceTypeEntry
(
typeof(ProcessActivator),
"ProcessActivator",
WellKnownObjectMode.SingleCall
);
RemotingConfiguration.RegisterWellKnownServiceType(remObj);
Console.WriteLine("Press [ENTER] to exit.");
Console.ReadLine();
}
My client has:
HttpClientChannel http_channel = new HttpClientChannel();
ChannelServices.RegisterChannel(http_channel,false);
IProcessActivator.IProcessActivator process_activator1 =
(IProcessActivator.IProcessActivator)Activator.GetObject
(
typeof(IProcessActivator.IProcessActivator),
"http://localhost:9000/ProcessActivator"
);
process_activator1.Run("IExplore.exe", @"http://www.codeproject.com");
There's also a library called ProcessActivator and it just has the run command... I included the remoting references.. The code runs fine when i run both the server and the client on the same machine... but they won't work with each on a separate pc...
|
|
|
|
|
Nevermind.. I figured it out..
I was making a call to the local machine instead of the remote machine(IP address)
"typeof(IProcessActivator.IProcessActivator),"tcp://localhost:9000/ProcessActivator"
Solution:...
Pass the IP address of the remote machine to the client application
"typeof(IProcessActivator.IProcessActivator),"tcp://192.168.0.104:9000/ProcessActivator"
|
|
|
|
|
I would like to write a picture viewer app that outputs the image over the entire screen, not just the desktop. I can't seem to find the solution to write over the taskbar. Any help would be appreciated.
Thanks
|
|
|
|
|
You need to set the window state to be set manually, and you set the coordinates of the window so that the Top and Left are 0. You can use Screen.PrimaryScreen.Bounds to work out what the width and height of your screen is. Obviously, you'd need to do more work if you wanted to cover other screens in a multi monitor setup, but the Screen class provides access to the other monitor information in AllScreens .
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thanks Pete, but this will only cover the desktop, not the taskbar.
|
|
|
|
|
Set TopMost=true; on this window.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
So simple... Thanks a lot Pete
|
|
|
|
|
So simple - that's me.
xax wrote: Thanks a lot Pete
You're welcome.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
dataview dv=new dataview();
dv = dtCompanyForm.DefaultView;
dv.Sort = "ID";
dtCompanyForm.DefaultView = dv;
but last line is getting error
|
|
|
|
|
swetha_insoft wrote: dtCompanyForm.DefaultView = dv;
you can use:
//to sort dataview
DataView dv = new DataView(dtCompanyForm, null, "Id", DataViewRowState.CurrentRows);
//to assign dataview to datatable
dtCompanyForm= dv.ToTable();
|
|
|
|
|
datatable dt=new datatable();
"dt" is having some values.
i wnat to sort these values using dataview....
can anyone help me
|
|
|
|
|
//Assume that my column to sort is "Id"
//Temp is my datatable
DataView dv = new DataView(Temp, null, "Id", DataViewRowState.CurrentRows);
GridView1.DataSource = dv;
GridView1.DataBind();
|
|
|
|
|
Hi Experts
i am using SQL Server 2005 and VS 2005
i Have Database in SQL Server 2005 in My db 120 tables ,35 SP,s ,30 Function i want to create whole database at run time using C#.NET.pls suggest me how many possiable solutions are and How To Create it.
tell me the example if possiable.
Thank u
Dinesh
|
|
|
|
|
Sharma Dinesh Kumar wrote: Database in SQL Server 2005 in My db 120 tables ,35 SP,s ,30 Function
Doesn't really matter in this case, what is the structure of your database.
Sharma Dinesh Kumar wrote: How To Create it
Have a look here at MSDN[^]. This only creates database, but you can enhance it further to execute your whole script.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
there are too many ways to do it, if you wish to use Linq to Sql Classes (.Net3.5), you simply create database with dbObject.CreateDatabase(); method call. or you can generate the create script with Sql Management Studio and then execute it with a sqlconnection object, otherwise there is tool named SQL_Packager[^] it makes these generating scripts and writing codes to execute it steps with simple wizarded UI.
|
|
|
|
|
|
i need help, suppose i have aspx page and inside aspx page one gridview,one dropdownlist and one print button.I have fill gridview onselectindexchanged event of dropdownlist.i want to take print of gridview on client side as well as datasave in database when i click on print button
sudhir kumar
|
|
|
|
|
Do not repost same question.
|
|
|
|
|
Make the "print" button a submit, when you click on it you submit form to page that stores this data in database, and then you redirect to a page which will re-render all this informaiton in gridview and call over JavaScript page print command which is called this way: window.print()
Maybe someone else has better suggestion, you could submit data over "AJAX", but, it's same thing, anyhow he need to submit this data, only if you would save it over ajax you would save some time re-rendering gridview.
|
|
|
|
|
Could you not find the ASP.NET forum ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi guys ....
I've been writ a simple program using sockets to send data from client to server
here is my program
server code
<pre>
public class SocketListener
{
public static string data = null;
public static void StartListening()
{
byte[] bytes = new Byte[1024];
IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());
IPAddress ipAddress = ipHostInfo.AddressList[0];
IPEndPoint localEndPoint = new IPEndPoint(ipAddress, 11000);
Socket listener = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
try
{
listener.Bind(localEndPoint);
listener.Listen(10);
while (true)
{
Console.WriteLine("Waiting for a connection...");
Socket handler = listener.Accept();
data = null;
while (true)
{
bytes = new byte[1024];
int bytesRec = handler.Receive(bytes);
data += Encoding.ASCII.GetString(bytes, 0, bytesRec);
if (data.IndexOf("< My 1st socket prog >") > -1)
{
break;
}
}
Console.WriteLine("Text received : {0}", data);
byte[] msg = Encoding.ASCII.GetBytes(data);
handler.Send(msg);
handler.Shutdown(SocketShutdown.Both);
handler.Close();
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
Console.WriteLine("\nPress ENTER to continue...");
Console.Read();
}
public static int Main(String[] args)
{
StartListening();
return 0;
}
}
</pre>
and client code
<pre>using System;
public class SocketClient
{
public static void StartClient() {
byte[] bytes = new byte[1024];
try {
IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());
IPAddress ipAddress = ipHostInfo.AddressList[0];
IPEndPoint remoteEP = new IPEndPoint(ipAddress,11000);
Socket sender = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp );
try {
sender.Connect(remoteEP);
Console.WriteLine("Socket connected to {0}",
sender.RemoteEndPoint.ToString());
byte[] msg = Encoding.ASCII.GetBytes("This is a test< My 1st socket prog >");
int bytesSent = sender.Send(msg);
int bytesRec = sender.Receive(bytes);
Console.WriteLine("Echoed test = {0}",
Encoding.ASCII.GetString(bytes,0,bytesRec));
sender.Shutdown(SocketShutdown.Both);
sender.Close();
} catch (ArgumentNullException ane) {
Console.WriteLine("ArgumentNullException : {0}",ane.ToString());
} catch (SocketException se) {
Console.WriteLine("SocketException : {0}",se.ToString());
} catch (Exception e) {
Console.WriteLine("Unexpected exception : {0}", e.ToString());
}
} catch (Exception e) {
Console.WriteLine( e.ToString());
}
}
public static int Main(String[] args)
{
StartClient();
return 0;
}
}</pre>
now I want to let 1st client "producer" generates random message and sends it to the server, then server checks the buffer, if there is enough space to store it, then it stores it, otherwise it neglects the message
and 2nd client "consumer" will be connected to the server and asks the server for data, the server in turn will check the buffer. If the buffer is empty then the consumer will wait
that's all and thank u
|
|
|
|
|
My application is having two listboxes.
first listbox is getting values from database
double click on first listbox value will remove from first listbox and add to second listbox.i completed this.
but my problem is double click on second listbox value should remove from second listbox and add to first list box and i already mentioned that first listbox is getting value from database.
|
|
|
|
|
Well, isn't it the same thing, but in the other direction ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
private void firstlistbox_DoubleClick(object sender, EventArgs e)
{
if (firstlistbox.Items.Count > 0 && firstlistbox.SelectedItems.Count > 0)
{
secondlistbox.Items.Add(lst_ApplicantGroups.Text);
dtCompanyForm.Rows.RemoveAt(firstlistbox.SelectedIndex);
firstlistbox.DataSource = dtCompanyForm;
//lst_ApplicantGroups.Items.Remove(lst_ApplicantGroups.Text);
}
}
//Above code is working fine
//but secondlistbox_doubleclick is not working.
//can anyone help me
private void secondlistbox_DoubleClick(object sender, EventArgs e)
{
if (secondlistbox.Items.Count > 0 && secondlistbox.SelectedItems.Count > 0)
{
string currentItemText = secondlistbox.SelectedItem.ToString();
int currentItemIndex = secondlistbox.SelectedIndex;
dtCompanyForm.Rows.Add(currentItemText);
secondlistbox.Items.RemoveAt(lstSelected.Items.IndexOf(lstSelected.SelectedItem));
firstlistbox.DataSource = dtCompanyForm;
}
|
|
|
|
|
What does 'does not work' mean ? What did you find was happening when you use the debugger ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|