Hi every body, I want to generate a random number between 0 and 30,000. How this can be done in C#. In C, it is like this. int Random = rand()%30,000; Could any one please help in this regard. thanks a lot.
Mohammed Aijaz Mohiuddin
Posts
-
I want to generate random numbers -
Problem in ThreadingFollowing is my code for a simple thread public static void U() { IPEndPoint ipe = new IPEndPoint(IPAddress.Any,1238); EndPoint LocalEP = (EndPoint) ipe; //Socket ServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); //ServerSocket.Bind(LocalEP); Console.WriteLine("I am codeproject user"); while(true) { Thread.Sleep(10); Console.Write(". "); } } It is surprised that when I use //Socket ServerSocket = new Socket(AddressFamily.InterNetwork,SocketType.Dgram, ProtocolType.Udp); the thread is not working .
-
I got stuck with streamwriter and cryptostream classesI am intereseted in developing network application where a server and client will just pass the text messages. I am using Tcp sockets. I could not incorporate networkstream classes in the context. I mean to say that I have to work with networkstream, streamwriter or streamreader and cryptostream classes put together. Hope you understand the situation.
-
I cannot include System.Runtime.Serialization.Formatters.Soap namespaceThanks for that Mr. Christian.
-
I tried a serialization deserialization network applicationI am trying to serialize a simple class over the network. I found the following error at receiver side. Additional information: Cannot find the assembly BinaryDataSender, Version=1.0.1934.14107, Culture=neutral, PublicKeyToken=null. What might be the problem? for this also I tried a lot to find the information regarding this, but in vain. MOhammed Aijaz MOhiuddin.
-
I cannot include System.Runtime.Serialization.Formatters.Soap namespaceDear all, I tried to include the above namespace in my new project of Visual C#. I could not do so. Later I tried on two other systems, the same problem. Then I opened a previous project of me, I find that System.Runtime.Serialization.Formatters.Soap namespace is there. Then I tried to include the same namespace by a dummy statement in previous project, I find that I can include the same namespace. What might be the reason ?, I have wasted lot of time and then consult this Message Boards. Thank you
-
I got stuck with streamwriter and cryptostream classesMy aim is to use the above specified classes for encryption and decryption on strings send across the network. I am unable to find how to use these two classes put together. Can anyone help me in this regard. Early response is encouraged.
-
I don't know how to use CryptoStream class with Streamwriter and StreamreaderHai to all, I want to create a simple TCP based network application, where client and server communicates with encryption. I tried to use streamwriter ans streamreader classes for non- encrypted application. I don't know how to use CryptoStream with the above streamwriter ans streamreader classes. Early response is encouraged.
-
I don't know how to use RandomNumberGenerator class.Can any one help to me in using RandomNumberGenerator class member functions. Early response is appreciated.
-
Good security project idea in C#?I require a good security project idea in c# which includes networking? I appreciate and welcome the ideas from you. This project will be a course project at my university. Thank you
-
Good security project idea in C#?Hai everybody, I require a good security project idea in c# which includes including? I appreciate and welcome the ideas from you. This project will be a course project at my university. Thank you,
-
I want to get C to C# code converter?Can I atleast get a C to Java code converter ?
-
I want to get C to C# code converter?I want to get C to C# code converter. Could anyone please help me in this regard.
-
I am unable to handle POST method. Response required as soon as possible.I want to develop a web server. When a user says from the browser http://localhost:8080 server must return a web page with text box and browser button and upload button. User can select the file and can click the button Upload. Let us say webserver.exe is present in c:\. When user clicks upload button this must be handled by the webserver and should upload the file to the same drive where the web server is running. I mean in C:\. In this case a POST method has to be handled. I am unable to handle the post method in my scenario. This will be regarding Content-Length,content-type processing. Can any one help me in this regard by specifying sample code. I am already running out of submission date.
-
Can I remote an abstract class with RemotingCan I remote an abstract class with remoting feature of C#.
-
I tried to set labe control property visible to trueThere are two classes. One is networkoperation.cs and Form1.cs Networkoperation.cs class contains a reference variable form to Form1 class in Form1.cs I am calling the function of Form1.cs Matrixdisplay() from one of the thread of networkoperation.cs class. like this form.Matrixdisplay(); In this function i implemented the visibility setting code.
-
I tried to set labe control property visible to trueI tried to set the label control property "visble" to true on a form. This i did from networkoperation.cs class which contains a field referring to form object in Form1.cs . I called a function Matrixdisplay of form as form.Matrixdisplay(row,col); This function contains public void Matrixdisplay(int row,int col) { for (i=0;i
-
I want XML to draw the network topologyI have a 4 X 4 matrix that represents a topologoy. suppose connected is that matrix. if connected[i,j]=1 then there is a edge between node i and node j. If connected[i,j]=0 then there is no edge. I want to encode this in XML format such that it must draw this network topology. Any one help will be greatly appreciated.
-
I have a network application which requires a matrixI have a network application which requires a matrix of boxes. So I decided to take label boxes with borderstyle as fixedsingle. Now each label acts as a box. Upto it is nice. But I need the main player to decide the size of matrix and this size example 8 X 8 matrix is send over the network to the sub player. Now by this size the sub player application has to draw these label boxes on the form. I don't how to do this. It is very urgent for my project. One more thing, All network operations are implemented in networkoperation.cs and application form class is Form1.cs . I have a reference to Form1 object as myform in networkOperation.cs class. Please help me in this regard as soon as possible.
-
I have a network applicationI have a network application. These two application has a form on which two label controls are present. Please see the diagram... Host1 Host2 Form1.cs Networkoperation.cs Form1.cs Networkoperation.cs class actually handles the communication between the two applications. What I Want? I want to have button on each form If I click the button the text present in a textbox on the form has to go the same label control and should be assigned to the Text property of the control. I am unable to do this, Because how to get the handle of label control of form1.cs class in networkOperation.cs Class? Any one who knows it Please help to me.