|
Hello everyone,
these days im thinking of building a chat server of my own with a chat application ofcourse too...
but im thinking about which technology i should use...
for me i already have knowledge in c++ and vb.net, but i believe that c++ is faster and i think c# is faster also from vb.net.
VB.net can do it, but again i think c# is faster...
so which language do u advice me to do it on, c++ or c# or vb.net, or even c++.net? and why? and which is faster? and is there articels that are helpfull that i cant read.
very thankfulllllll
|
|
|
|
|
Good, so you know a few languages - now you need to understand the technology. All .NET languages - i.e., those that target the CLR - compile down to Microsoft Intermediate Languages (MSIL), an extension of Intermediate Language (IL). This means that no language is necessarily faster than one or another. The major differences between the compiled forms of VB.NET and C# are that VB.NET makes allowances for a few conventions (like, instead of using Return value , you can still do FunctionName = value like in VB). I've studied the differences between the assemblies that are generated and the IL is almost exactly alike in every case.
As far as C++.NET goes, the only time that it is a lot faster is when you use mixed mode assemblies, or those that use both native instructions and IL. First, this is bad in many cases (such as touchless deployments over the 'net) because unverifiable code is present in the assembly (that which the CLR does not and cannot manage). For the very same reason, it is also dangerous. The CLR is called the managed runtime because it manages all memory. When you use native code, you are again managing the memory (like in C/C++) and the CLR cannot manage it or even verify the types.
So, one is not really faster than the other when you're talking about pure .NET assemblies. Use whichever language you feel most comfortable, while being cautious with C++.NET because of its unverifiable nature (there are several articles in the .NET SDK that deal with this topic - you might want to take a look at them to fully understand the consequences).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
hi
thank you alot for ur advice, its really valuable
i think im gonna work it on c#, although my experience is in vb.net, well mmm, i dont know why but i feel from my inside that c# is faster when there is stress on the server, i didnt read anything about it, but its just a feeling, so i dont know if its true
and i want to ask u , is there any tool i can use it to test my server when i do it under stress? i wish so
and if there any articles or anything that can help me in this
im really thankfull for uu
Kind Regards
|
|
|
|
|
I've tried the code below, and various code frm a number of books, I'm using V1.1. I know there is a image on the clipboard because I can paste a copy to the same folder as where I copy/cut the image.
(I know the code looks weird, but I've tried bothversions with the other one commented out)
If anyone has any code that works I'd be gratefull, this might also be releated to a problem whereby I can drag a image from a folder to my PB, but not from IE or Mozilla.
I'm very new to C#, so help really is needed
private void mnuPaste_Click(object sender, System.EventArgs e)
{
IDataObject d = Clipboard.GetDataObject();
if(d.GetDataPresent(typeof(Bitmap)))
{
Bitmap b = (Bitmap)d.GetData(typeof(Bitmap));
b.Save(@"m:\mybitmap.bmp");
MessageBox.Show("Bitmap saved to disk!!");
}
else
{
MessageBox.Show("No bitmap information was contained in the clipboard.");
}
// Create a new instance of the DataObject interface.
IDataObject data = Clipboard.GetDataObject();
// If the data is text, then set the text of the
// TextBox to the text in the Clipboard.
if (data.GetDataPresent(DataFormats.Bitmap))
{
//textBox1.Text = data.GetData(DataFormats.Text).ToString();
// Yes it is, so display it in a text box.
picCoverFront.Image = (Bitmap)data.GetData(DataFormats.Bitmap);
MessageBox.Show("paste") ;
}
}
|
|
|
|
|
trythat wrote:
(Bitmap)data.GetData(DataFormats.Bitmap);
This piece of code is important. A clipboard data object (also used in dragging and dropped) uses one or more clipboard formats. These are merely strings. .NET makes it easy by registering these clipboard formats for you. The important thing is that the strings match from source to target. When you copy a bitmap from most applications (including Windows Explorer, Office, etc.) - and even your application above (the lower part), you use the string value for DataFormats.Bitmap . In your target app (the upper code), you are using typeof(Bitmap) , which yields an entirely different string! Instead, do:
if (d.GetDataPresent(DataFormats.Bitmap))
{
Bitmap bmp = (Bitmap)e.GetData(DataFormats.Bitmap);
} The string you use isn't so much important (unless you want to be compatible with common formats when copying/pasting with other applications) as it is that they match between your source and target applications.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
// Create a new instance of the DataObject interface.
IDataObject data = Clipboard.GetDataObject();
if (data.GetDataPresent(DataFormats.Bitmap))
{
Bitmap b = (Bitmap)data.GetData(DataFormats.Bitmap);
b.Save(@"m:\mybitmap.bmp");
MessageBox.Show("Bitmap saved to disk!!");
}
else
{
MessageBox.Show("No bitmap information was contained in the clipboard.");
}
Thanks for answering, but I still can't get it to work, I tried the above code and it always falls thru to the else statement, even though I'm trying to paste a jpg, all I really want to do is paste a image to my PB.
Do I need to have any code added anywhere else or SHOULD the above work?
|
|
|
|
|
I don't know off the top of my head, but copying a JPG file may not use the DataFormats.Bitmap clipboard format. The best thing I can tell you is to set a breakpoint at your condition and debug your app to see what formats are there. You can also use ClipSpy[^] to also see what formats are being used.
What exactly are you copying this file from? If you're doing it in your own program, make sure you copy the data into the DataObject the same way and using the same clipboard format as you do when you retrieve it.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks again, downloaded Clipspy - I'll have a good read first
I'm trying to copy mainly from other folders, I can now drag&drop from another folder, but not from another program - mainly IE. I only want to paste/drag&drop to my program, and the books make it look so easy they all seem to be the same code I pasted in my first message - so I'm not sure what I'm doing wrong.
|
|
|
|
|
The only thing you seem to be doing wrong is using the wrote clipboard format. Be sure to copy a JPEG from Windows Explorer into the clipboard, then examine it with ClipSpy to see what formats are there. If DataFormats doesn't have the string you need represented, just pass the string itself - that's all that it is). If nothing else, read the sections of the Windows Shell documentation in the Platform SDK that deal with the clipboard, dragging and dropping, and clipboard formats. I did many many years ago and I'm glad I did.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks Heath, I'll try that out and see what I can manage, I'm also going to have a quick gander at the Clipspy source to see if I pick some tips up from there as well.
Thanks again -
|
|
|
|
|
I'm currently writing a C# MIME parser and a problem has occured, encoding
I've written a hack that converts iso-8859-1 to a readable form by taking out the ASCII-value of the characters and then replace the code (for example =E5 is the swedish character 'å') with the corrent character. But today I got a nasty spam with the following text (in the header) that I don't know how to encode:
From: =?koi8-r?B?6OhMLfRB6EkgKDk5NS04Mjk0KQ==?= <mc7yfccu@buch.de>
The charset is koi8-r, but then? According to another email-client the correct translation is èèL-ôAèI (995-8294) <mc7yfccu@buch.de>
Is there a general way of converting strings with known encoding-strings like koi8-r, iso-8859-1 etc?
// Niklas
|
|
|
|
|
Take a look at Encoding.Convert (and the various encoding-related classes). This converts to/from ASCII, UTF7, UTF8, and Unicode, so any charsets should be able to convert.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi,
This encoding is called as Canonical encoding.
Format: =?charSet?type[Q or B]?encoded string?=
Q - quoted-printable encoding
B - base64 encoding
You can see my developed mime parser, it hanles all this stuff.
http://www.lumisoft.ee/lsWWW/Download/Downloads/Net/;
P
|
|
|
|
|
hi !
i would need some performance comparisons. (charts, ...)
best would be java , c#
espacially for socket-operations.
does anybody know where to find such info.
THANKS !!!
|
|
|
|
|
This has been covered to death in this forum. Please click the little "Search Comments" link above. It's not worth repeating for the 100th time.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi,
I compile my c# apps on c# builder/visual studio .net at my XP , and it does work great , the problem occurs when I try to run the excutable on another XP/computer , it gives an error message
"The application failed to initialize properly(0xc0000135).Click on OK to terminate the application" , the hexa number isn't stable it changes for each excutable.
what/where may be the problem?
hope you reply soon
thanks,
shon9
shon9
|
|
|
|
|
Hi
Setup on another computer Framework.NET
|
|
|
|
|
your probably missing a .dll that the particular program needs to run.
/\ |_ E X E GG
|
|
|
|
|
Hi, I really nead a C (not c++) code for deconvolution of signals (not images)
Is there anybody that can help me? I'll be very happy.
Thanks, Angeluna.
|
|
|
|
|
Angeluna wrote:
Is there anybody that can help me?
No
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Try the Visual C++ forum, please.
|
|
|
|
|
I have to write an application that has to track all applications that have been opened. Basically I have to record when an application was launched, from where (which file) it was launced. I have no idea where to begin. Any ideas?
Thanks
|
|
|
|
|
It's easy to get a list of the processes that are running, and when the started and finished, .. mmm.. take a look to
System.Diagnostics.Process
Some time ago I make an small tool that just pooled for something like that.
|
|
|
|
|
Hi,
I'm just new to C#.net I just want to know how to create a global database connection, so that I will only use one connection in my application in all my forms. Hope I can find the answer... Thanks...
|
|
|
|
|
Hi,
you could create an static class, and have a method called "getConnection" from there you can get the connection from anywhere.
Just one advice... I would use connection less, instead of single connection, ... just connect to the database when you need it, the .net Framework keeps a pool of connections so no loose of performance when reopening the connection
HTH
Braulio
|
|
|
|