|
I'm trying to make a chat server. I can make a server/client connection and use that to chat back and forth between the server and the client.
But I need to be able to have multiple clients and I don't know how to do that at all.
Can someone help me with this? Is there a tutorial for making a chat server in C# somewhere or an example of one I can look at?
|
|
|
|
|
|
Using Plain Socket connection
|
|
|
|
|
Smithakrishnan wrote: But I need to be able to have multiple clients
Your server program should be multi threaded. Are you using a socket connection ? If yes you have to keep all your client objects in an arraylist for further communication. When a new client is connected, create a thread for him and keep it's object in an array list/list.
|
|
|
|
|
Hi All,
Can any one please tell me how to make a grid editable on a keypress.
My exact requirement is I have a Gridview1 which has the edit column and can be updated.
but I have been asked to do it in a keypress for eg. if some press F2 the row should be Editable.
Thanks in Advance
|
|
|
|
|
you can code in keypress event to check for F2 key press and then set the edit mode of your grid
forexample
dataGridView1.EditMode = DataGridViewEditMode.EditOnEnter;
|
|
|
|
|
2 simple way to complete your requirement.
1.) add a menustrip in your application, then add an item and set the shortcut to f2
2.) add a keyboard event handler in your app and detect if key == Key.f2
either way to fire a function to set the gridview tobe edit mode.
|
|
|
|
|
Sorry I forgot to mention that Im in Developing WEB APPLICATION
|
|
|
|
|
you can add a javascript event capture the keypress, if event == f2, then fire the callback and set the gridview as editmode.
FYR.
function dosomething()
{
var key = window.event.keyCode;
alert(key);
}
|
|
|
|
|
Since f2 is a functional key ..can you please tell how to get the keypress value for it
|
|
|
|
|
got it through onkeydown event thank you
|
|
|
|
|
I writing my two object student and campus to a xml file but i am wondering is there a way to create student or campus object directly from the xml file. I mean I want to instiantiate student class if my program reading student data or campus from the xml file.
I couldn't find any simple example
Thanks for ur help in advance
|
|
|
|
|
You should use the XmlSerializer[^] class. The documentation contains examples of its usage.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Well, if you use XML serialization you can then create your objects from whatever source, serialize them onto your HDD and the opposite again.
Check this article out: http://www.codeproject.com/KB/cs/objserial.aspx[^]
happy coding
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
The other two posts suggested the right solution but i would like to add
that u have to design classes for that.
for example to load students directly from your XML file u need two classes
one contains the student properties whose each object represent one student and the other class to hold the collection of these student class objects
|
|
|
|
|
Thank you all, but when i was going throught i find it so confusing. There isn't a simple way. Ya i understood that i need 2 classes and their properties can anyone of you show me some of ur way teaching it or explaining it. I thank you all
|
|
|
|
|
Hi,
i've to send SMS message to a mobile phone from Pc (using C#.net
application)
i dont know which namespaces to include and what requirements i need in
order to full fill this requirement
.. Send messages of up to 160 text characters to any South African
cellular subscriber and many international subscribers as well.
can anybody tell me how can i send messages to mobiles phone through c#.net application.
Thanks
Smitha
modified on Wednesday, December 05, 2007 1:01:52 AM
|
|
|
|
|
Smithakrishnan wrote: i dont know which namespaces to include
Well, you could invent some, I suppose.
Did you try google ? Who is this requirement coming from, do they have any idea if it's possible or not ?
There are webservices that can be used to send SMS, dunno if they work in South Africa. I guarentee that no namespace is going to magically connect you to the mobile phone network, how did you expect it to ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Check out http://www.smscountry.com/[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
hi,
i take one data set using ado.net(sql server 2000),
i take one crystal reporti,that is name is crystalreportTest,
its file path is c:\Test\CrystalReportTest.rpt,my web application in c:\Test,
my dataset name is DataSetTest,i use this dataset in my crystal Report,i take crystalviewer1 &set the report source which is CrystalReportTest.rpt,
following code are used for solve the login problem(in crystalviewer property i remove logon prompt properties)my code is as follows-----
using CrystalDecisions.CrystalReports.Engine.Migration ;
using CrystalDecisions.Shared;
using CrystalDecisions.Shared.Interop;
using System.Data.SqlClient;
using CrystalDecisions.Web;
using CrystalDecisions.Enterprise;
using CrystalDecisions.ReportAppServer;
using CrystalDecisions.Reporting.WebControls;
using CrystalDecisions.ReportSource;
using CrystalDecisions.CrystalReports;
using CrystalDecisions.Web.Services;
public partial class _Default : System.Web.UI.Page
{
TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
CrystalDecisions.CrystalReports.Engine.Database crDatabase;
CrystalDecisions.CrystalReports.Engine.Tables crTables;
CrystalDecisions.CrystalReports.Engine.Table crTable;
CrystalDecisions.CrystalReports.Engine.ReportDocument crReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
protected void Page_Load(object sender, EventArgs e)
{
crConnectionInfo.ServerName = "SERVER";
crConnectionInfo.DatabaseName = "RESERVATION";
crConnectionInfo.UserID = "sa";
crConnectionInfo.Password = "sa";
crDatabase = crReportDocument.Database;
crTables = crDatabase.Tables;
crReportDocument.Load(@"C:\Test\CrystalReportTest.rpt");
for (int i = 0; i < crTables.Count; i++)
{
crTable = crTables [i];
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo =crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
crTable.Location = "RESERVATION.dbo." + crTable.Location.Substring(crTable.Location.LastIndexOf(".") + 1);
}
CrystalReportViewer1.ReportSource = crReportDocument ;
}
}
i use ReportDocument because in my application crystal report object is not set,
when run my code it shows Invalid report file path.i don't know what is happinning ,
i have done lot of research on it but i don't findthe right solution,
i don't know what is my mistak,when i run this code ,plz help me anybody
thank you very much for your support
asp.net using c#
modified on Wednesday, December 05, 2007 12:40:11 AM
|
|
|
|
|
Hi
i am working on .NET 2.0 winforms. in my form there is cancel button, in this event i am showing warning message "do u want to save the changes?". I need to show same message on when clicking on wikndow X button?
how can i do...
any sounds greatly appriciated
Ramana
|
|
|
|
|
Check with the form events, it got some events which will fire when a form ends. Somethink like closed, closing etc
|
|
|
|
|
i will write the code in closing event. but if user will clicks on X button, and on No, then how can make window re-active?
Ramana
|
|
|
|
|
There should be a "cancel" property in the event args of the closing-event. If you set this to true the closing will be - well - canceled.
|
|
|
|
|
Hi,
Form.FormClosing event is the prefered one since .NETY 2.0
set FormClosingEventArgs.Cancel true to cancel the close operation.
and maybe FormClosingEventArgs.CloseReason will be useful too.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|