|
It seems working now. Thanks a lot.
|
|
|
|
|
I've just started c sharp a few weeks ago and I need help on an about box.I have the Aboutbox Class and my main program.How do I make the about box pop up, like in a link or somthing?I've gotten close but the program says I'm using AboutBox as a variable.
-- modified at 10:13 Sunday 18th June, 2006
|
|
|
|
|
Post some code please. But usually you do something like this:
AboutBox box = new AboutBox();
box.Show();
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
Hi everybody!
I'm trying to use DCC protocol on IRC to transfer file. I did a small client who connect on IRC and there is no problem. The problem is at the moment to accept a file.
Dcc is working like that:
On a connection:
* Accept the connection.
* Close the original passive socket.
* Conduct transaction on the new socket.
Acceptor:
* CTCP DCC request received.
* Record information on the DCC request and notify the user.
* At this point, the USER should be able to abort (close) the request, or accept it. The request should be accepted with a command specifying the sender, type, and argument, or a subset of these where no ambiguity exists.
* If accepted, create a TCP socket.
* Connect the new socket to the address and port supplied.
* Conduct the transaction over the socket.
What i'm receiving on IRC looking like that:
:SenderNickName!Sender@Userhost.com PRIVMSG MyNickname :DCC SEND "afilename" 67975159 4503 3190353
After the filename, this is the IP, the port to use, and the filesize!
I'm supposed to connect on this IP and PORT using a socket (Well, I THINK) but it doesnt work. I always get an error message telling that my connection has been refused!
This is what I tried to do for the connection:
long ip = long.Parse(txtIP.Text);
int port = int.Parse(txtPort.Text);
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
s.Connect(new IPEndPoint(new IPAddress(ip), 0));
If anyone know a solution, it would really help me!
Thanks
Max, Dinamik.ca!
|
|
|
|
|
Socket connection refused?
A couple of things come to mind: What protocol? You specify IP, could it be that you need UDP?
Of course, the only other two options are the ip address and the port.
You may have something wrong with the IP address, port or Protocol. In Java, the IP address is a type in and of itself, in the example above, you've specified it as a long. At the link level it does indeed get translated at the packet layer as a long.
If you feel that all of your vars. are correct, then the other side simply isn't listening. You can download Ethereal and trace the data flow.
What you should see in the trace is this;
Syn ------->
<-------Syn Ack
Ack-------->
If you see a Syn ----> with no response, the server is not listening.
If you see all three, then you are in session and must follow the DCC protocol. If a Fin or Rst flies after you are in session from the other side you are not following the protocol.
|
|
|
|
|
Can anyone tell me a regular expression for date of format dd/mm/yyyy?
Thanks in advance.
|
|
|
|
|
That depends on what you are trying to do. If you want to verify the basic format, a simple pattern like "^\d\d/\d\d/\d\d\d\d$" would do. You could make it more complex to verify if the date looks reasonable, but verifying if the date is truly a valid date is beyond the scope of regular expressions.
---
b { font-weight: normal; }
|
|
|
|
|
Is there any way to find out ,progamatically or by using macrodefinitions, what version of .net has the compiler?
Thank you.
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
They all have compilers. There is no macro support in C# that will show you the .NET version or the Visual Studio version. Each version of Visual Studio will only work with one version of the .NET Framework.
VS.NET 2002 -> .NET Framework 1.0
VS.NET 2003 -> .NET Framework 1.1
VS.NET 2005 -> .NET Framework 2.0
This doesn't mean that the app won't work with an older version of the Framework, however. For example, so long as your app is not using anything specific to the .NET Framework 2.0, you're app should run just fine under the 1.1 version.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am sorry, I didn't expressed well...
I am trying to make components compilable on both .Net 1.1 and .Net 2.0 using "platform specific" GUI. Meaning that for example, on 1.1 it uses MenuItem and on 1.0 MenuItemStrip.
So I have to make some choiches based on the core version.
Is there anyway to find out what version I am facing?
ps: Thank you for your previous answer
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
Your best bet would be to write a small C++ program that checks the registry (or some other source) for all sorts of .NET frameworks installed. Then you would start your .NET assembly that matches the framework version. So I think you need to compile your program both against 1.1 and 2.0 (using pragma directives) and then start the appropiate assembly.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
the easiest might be just to check if those types are available:
if (Type.GetType ("Some.Name.Space.Some20specificTypeName",false,false) != null)
{
//you are in 2.0
}
else if (Type.GetType ("Some.Name.Space.Some11specificTypeName",false,false) != null)
{
//you are in 1.0
}
else
{
}
however I usually make 2 solutions , one for 1.x and one for 2.0
and define a conditional var like "net20"
#if NET20
#else
#endif
//Roger
http://www.puzzleframework.com
|
|
|
|
|
Your ideea is interesting, I think I will consider it. But the main problem is that the code will fail to compile for the 2.0 version if is compiled from the 1.1 - ie. compile, not execute.
Macrodefinitions and conditional code was what I had in mind. I thought that there was some kind of macro __dotNet1_1 or __dotNet2_0 defined standard.
My intention was to make the code usable with no user intervention, but currently I think that this is impossible.
Thanks for the answer.
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
Vlad Stanciu wrote: My intention was to make the code usable with no user intervention, but currently I think that this is impossible.
Just don't use any .NET 2 classes or constructs (such as anonymous methods) and then it will automatically, and hopefully happily, compile under both regardless of which version is used.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
The best programming way may not be the simplest...
Btw, in your post you suggest me not to do what I want, the source of the whole thread
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
Vlad Stanciu wrote: Btw, in your post you suggest me not to do what I want, the source of the whole thread
Well then the only solution is that you're going to have to maintain "two" different versions, those that use .NET 2 classes and constructs and those that don't. This can either involve having two seperate solutions / projects / directories or by using a hell-of-a-lot of
#ifdef DOTNET2
#elif
#endif It's the only way I'm afraid.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
Ed.Poore wrote: Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
hi every body
i need help in getting an input to the parallel port using c#
i read about using timer with round robin method , please help me
thanx for reading my message
hi score
-- modified at 6:44 Sunday 18th June, 2006
|
|
|
|
|
Um, Google!
http://www.google.co.uk/search?q=reading+from+parallel+port+%2Bc%23[^]
How about looking at the first result, exactly what you want me thinks.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
hi all,
i create installer class that will run while installation but it will receive value from user during installation
what is the proper way for this?
thank you
|
|
|
|
|
Depends on what you're using.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
|
|
|
|
|
Could someone please suggest the least problematic way of storing tables that have been created and filled with data runtime, into a SQL server database.
I am also looking to name the new tables in the database sequentially.
Any suggestion would be appreciated.
|
|
|
|
|
|
That sounds like a good way of arranging things, however as a beginner I am having problems managing items such as datasets and tables that are being created dynamically as the program runs and items that already exist as they have been created in the IDE, such as data sources, table adapters ETC.
I am working on a data import program so the conventional approach of creating a database , data source, tables, table adaptors, and so on in the IDE doesnt work as there is no data to begin with.
I currently have all my imported data in a datagrid , parsed correctly , just would like to know the best way of moving this to a blank SQL database.
Thanks for all the help so far
|
|
|
|