|
My teacher give me a project ,it is "use .net to implement internet message board ,it includes the implement of the server ,the implement of the client...",mine is the implement of the client ,I just want to know where to start,my teacher said like the chat room is one of the example ,could somebody tell me where to start ,many many thanks
|
|
|
|
|
|
OK, lets have a look at your problem:
Implementation of information exchange over TCP/IP.
First, there are 2 types of participants in this system: The Server (which stores all data and provides clients with the necessary information) and the Client (which displays data to the user and allows users to send information to each other).
Thus, this is called "Client-Server-Architecture".
First, you need to specify what your client should be able to do. Are you implementing a chat-system (near realtime) or a message board (not realtime).
Second, you need to specify HOW data is transferred from the client to the server and vice-versa.
This really is up to you. for a simple chat system, this would be something like:
Client-to-Server: nickname, flags (color, bold or whatever) and message.
Server-to-Client: timestamp, nickname, flags, message
The Client would be running a UI with 2 threads: one sending thread and one listening thread, where the sending thread transmits everything from an input-field when ENTER is pressed and the receiving threads listens for messages from the server and updates a chat-window accordingly.
The Server would simply have an array of sockets to his clients and forward every arriving message to every client (or specific clients, if there is a "private chat" included), stamping each message as it arrives. You could call that "mixing", as the server arranges all messages by their arrival timestamp.
With a message board, you also will have to think about retrieving only certain messages (in order to preserve bandwidth) and how to authenticate yourself at the server.
Of course, this is just my opinion.
Cheers
Sid
|
|
|
|
|
hi all,
i need to view a html(say abc.html) in my form and compare it to another html . both these should be placed side-by-side. i need to add synchronized scrolling to these.
any inputs?
thanks
|
|
|
|
|
After hours of googling, i concluded... it is NOT possible to set a custom paper size through the pagesettings class. (i mean printdocument.defaultpagesettings.papersize = new papersize(...) )
Please correct me if i'm wrong!!
(PD: i've found lots, and i mean lots of posts in many web sites about this ... wow ... nobody can set a new papersize? I tested this in vb 6.0 and i CAN do so in three lines of code, but seems impossible to do in C#)
|
|
|
|
|
itis not a bug reflex cuz it is so easy but hiding some much
it is in PaperSize property in the PrinterSettings.PaperSizes Collection
and in only one line of code
ByMindOnlyYouCanDoIt
|
|
|
|
|
1) Via PrinterSettings.PaperSizes you cannot add a CUSTOM PaperSize (You CAN do so in .NET Framework 2.0, BUT, it has the SAME BUG!!!)
2) Via DefaultPageSettings.PaperSize you CAN create a custom PaperSize, BUT it is NOT used on the printer...
|
|
|
|
|
I was reading the article C# Server Enumerator By Phil Bolduc
because I am trying to figure out how to build a database connection dialog for an application that should be flexible about which database server and which database I connect to.
My problem is that the sampe code does not run....
If there is a Network Managment namespace somewhere, I don't know where to find it.
I realized this snippet was not comlete because there was no main method, but that is not all that is wrong. Can anybody point out where I am going wrong?
// His code here...======================================================
using System;
using NetworkManagement;
//
// List all the SQL Server database to the
// console (using foreach)
//
Servers servers = new Servers( ServerType.SQLServer );
foreach (String name in servers)
{
Console.WriteLine(name);
}
//
// List all the Domains to the console.
//
Servers servers = new Servers( ServerType.DomainEnum );
IEnumerator i = servers.GetEnumerator()
while ( i.MoveNext() )
{
string domainName = (string) i.Current;
Console.WriteLine(domainName);
}
// My code here... ==========================================
using System;
using NetworkManagement;
namespace ConsoleApplication2
{
///
/// Summary description for Class1.
///
class Class1
{
Servers servers = new Servers( ServerType.SQLServer );
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
//
// List all the SQL Server database to the
// console (using foreach)
//
foreach (String name in servers)
{
Console.WriteLine(name);
}
//
// List all the Domains to the console.
//
Servers servers = new Servers( ServerType.DomainEnum );
IEnumerator i = servers.GetEnumerator()
while ( i.MoveNext() )
{
string domainName = (string) i.Current;
Console.WriteLine(domainName);
}
}
}
}
|
|
|
|
|
|
hi
i create a web application with c# and use code behinde.
its now on my desktop computer and i want to deploy it to my web site.
How i can do it?
|
|
|
|
|
Hi,
You can deploy it by copying the .dll and the content files into correct folder. Or else we can create Web Setup project for deploying the web application.
http://www.15seconds.com/issue/030806.htm Gives you more information on this.
Thanks
SGS
|
|
|
|
|
#1: Does this server support .NET apps (does hit host it, many providers ask for payment for apps).
#2: Does the server has IIS installed, if not, forget it.
#3: if all OK, upload the content files and the dll's (in the bin directory) to the server (keep the directory structure)
#4: Create a virtual folder on IIS and link it to the folder where you copied your app.
#5: now you should be able to surf to the page.
No hurries, no worries.
|
|
|
|
|
When I add items to a ListView control and the amount of items exceed the size of the control a vertical scroll bar appears (I have set scrollable to true and this is what I want). My question is when I continue to add items the ListView control adds the new item at the end of the control (as it should) however the ListView control always shows the items that were entered first. That is I have to use the mouse to drag the scroll bar to see the last entry. Is there a way to program the ListView control so when it adds a new item you see the new item at the bottom of the ListView control without manually dragging the vertical scroll bar?
Thanks
|
|
|
|
|
I guess when you try all day and finally decide to go to the message boards you find the answer.
There is a public Method (EnsureVisible) that will auto scroll the ListView if necessary to make visible the ListView Item of your choice:
lstVwResults.Items[lstVwResults.Items.Count - 1].EnsureVisible();
The above code will ensure the last item added to the ListView control will be displayed.
|
|
|
|
|
I have writen a dll in VC++ project. how can I call the function in the dll from a C# console project?
I think there must be a way. I just don't know how to do it. BTW, I am newbie of C#. I use Visual Studio .Net.
Thank you.
|
|
|
|
|
xianwuluo,
It would help to see the signature of the unmanaged function you want to call, so instead all I can do it point you at the documentation online in the .NET Framework SDK, entitled Consuming Unmanaged DLL Functions[^].
A simple example follows:
EXTERN_C __declspec(dllexport) HRESULT Foo(LPCTSTR pszA, DWORD cchA);
[DllImport("mydll.dll", CharSet=CharSet.Auto)]
static extern int Foo(string pszA, uint cchA);
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
OK, so you want to strip the <b> and </b> tags, you want ALL the other text, including the text inside the bold tags ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
simply i don't want the or in the above i want to exclude them, any help plzz...
regards
|
|
|
|
|
simply i don't want the <b> or </b> in the above i want to exclude them, any help plzz...
thanx and regards
|
|
|
|
|
sorry i didn't see your replys , only when i whent out of the message bord and then returned i found out that i've repeated myself.....
ya actually i just want to exclude the <b> and </b>: eg. (.+(not <b>nor</b>))
|
|
|
|
|
If your just want to remove a fixed part of your string, you could simply use string.Replace("<b>", ""); followed by string.Replace("</b>", ""); to strip out the bold tags.
What remains can then be parsed with regex, of course.
mav
|
|
|
|
|
thanx mav but this will replace the tags witch a space i suppose i just want exclude the tags from appearing with the group when i use this expression:
<td.+><font.+><a.+>(.+)"
i get results desired like:
<prog>Hi to All
but also get undesired extras some times():
<prog>Bob Harris
thanx and regards
|
|
|
|
|
ignore the above i've forgoten to disable html:
<td.+><font.+><b><a.+>(.+)</a></b></font></td>"
i get results desired like:
<Prog>Hi to All</Prog>
but also get undesired extras some times(</b>):
<Prog>Bob Harris</b></Prog>
thanx and regards
|
|
|
|
|
hi there how wud i exclude a certain tag or character using regular exp.:
<a.+>(every character but not the <b> or </b>tag )</a>
!!!!
thanx and regards..
|
|
|
|
|
Match all either side of the tag, and then return the matches ( so the tab is left out ).
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|