|
This is really simple.
The application running on each of the client machines calls out to the server when it stats up and establishes a connection. This way the server knows about each client system. It is each of these client applications that is capable of actually displaying stuff to the screen (opening up windows) but it only does it under control of specific messages from the server.
When the server application wants to open up a specific window on the client machine it just uses the already established socket connection to send a simple message to that client (known by the IP address of the client). This can be as simple as a string like "OpenWindow:WindowName".
When the client gets this message it parses it apart, determines that the message is a command to open a window and then determines what window it should display and then shows that window.
Of course if this is a game at which people are going top win money you may want to do something over the wire like some encryption and secure identification to be sure that a client is one of your apps and not some rodent application just sneaking in on your data stream to get cash.
|
|
|
|
|
Hi Ray!
That sounds great! Forgive me for my ignorance, I have never done anything like this before. So if I understand correctly, I create a tcp socket between the two apps. Does the client call to the server automaticly or do i need to put some code there?
And then I just send a simple string to the client, based on that string, it will open a form. Right?
I guess I'm a little confused because I have never worked with client/server apps before. I understand how the string could work in the same application, but it's a little like voo doo right now with two diffrent apps.
Would you have a simple example that I could look at. I just need to take a look at how the could would look. Do I still need to build a shared class like I would in .net remoting?
Thanks for all you help with this!
Rudy
|
|
|
|
|
rudemusik wrote: I create a tcp socket between the two apps.
Right. You can also use UDP if you want but for something like this TCP is probably better.
rudemusik wrote: Does the client call to the server automatically or do i need to put some code there?
You have to code the request for connection from client to the server and then code the connection request form the client on the server also. Can't expect to have the framework do it all for you
rudemusik wrote: Do I still need to build a shared class like I would in .net remoting?
Nope, no shared classes at all. Two completely separate application projects that just talk to each other over a socket connection. Look at this setup to be like and FTP server and client. Each one can be made by different people and as long as the follow the same language (FTP commands) they can talk to each other. All any network system really is just a socket connection and commands sent over that connection. It's just that some of the connections use well known port numbers like 110, 21 or 80.
Examples of basic socket stuff:
TCP/IP with VB.NET
http://www.codeproject.com/vb/net/VbNetSendReceiveTcp.asp[^]
VB.NET TCP Client - Server Socket Communications
http://www.eggheadcafe.com/articles/20020323.asp[^]
VB Express Socket help
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=139466&SiteID=1[^]
Hope this helps.
|
|
|
|
|
Thanks Ray!!
It helps quite a bit! I appreciate your time explaining this to me. I think I should get it now.
Thanks again!!
Rudy
|
|
|
|
|
hello
i need some free component (dll activex controls and etc..)for validating input ,for user login and for scanning and printing and for user interface (in vb.net 2003)
can any body give me a refrence link
thank 's a lot
|
|
|
|
|
aspnet_22 wrote: i need some free component (dll activex controls and etc..)for
aspnet_22 wrote: validating input
Look in the ToolBox. VS comes with Validation controls.
aspnet_22 wrote: for user login
In 2005, there is a pre-written form that you can add for this. Otherwise, it's quite easy to put your own form togther. The hard part will be writing the account database and encrypting passwords properly. I don't know of any component that will do this for you.
aspnet_22 wrote: printing
Again, this stuff is already in the ToolBox. Even if you found a component to do this, you still have to supply all the printing code.
aspnet_22 wrote: user interface
Huh?? takes a second look... What?????? You want a control to generate a user interface for you??
aspnet_22 wrote: scanning
A little Google goes a long way...click[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thanks for your reply,
i mean that i want the component that the professional programers use to create their very big project fastly.are they only use .net toolbox component and nothing else.?
|
|
|
|
|
No. For stuff like you mentioned, they write their own controls because most of the code you have to supply to get this stuff to work is custom written for each app.
Validation is very data-specific so there is no "generic" control that does it for you. You have to supply most of the code anyway to validate your own data so why would anyone try and sell a control that only supplies 15% of the code?
Same thing for user login. All that requires is a couple of TextBoxes, one of which should be backed by a SecureString. Again, you have to supply most of the code because on you know how your user database is stored and, hopefully, how you encrypted your passwords.
Printing - again, you have to supply just about all of the code because only you can possibly know how your application is going to print what it needs to. The ToolBox supplies the basic controls you need to get a consistant interface in picking a printer and supplying a print preview, but that's about it. The rest is entirely up to you.
User Interface - I have no idea what you meant by this one...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
In VB.NET 2005, INSERT, DELETE, UPDATE Staments for a TableAdapter can be generated automatically by the TableAdapter Configuration Wizard; but not for the two related tables.
I find it very hard creating these statements manually. I request the members of this forum to help me with some examples.
My question is more explained as below:
I am using the following SQL statement:
SELECT tblDrugs.DrugID AS DrugID, tblDrugs.DrugName, <br />
tblDrugs.PriceID AS PriceID, <br />
tblPrices.* <br />
FROM tblDrugs LEFT JOIN <br />
tblPrices ON tblDrugs.PriceID = tblPrices.PriceID
When my VB2005 program executes the following statement:
Me.taDrugs.Update(Me.myDataSet.tblDrugs)
The above Update method expects the relevant Update statement, which has to be provided manually in this case - because TableAdapter Configuration Wizard does not generate this statement for the SELECT with 2 related tables (joined).
What I want is the Update statement, which can satisfy the Update method of the TableAdapter - taDrugs in the above code.
|
|
|
|
|
Sir,
I want to make a program that generates the password.The program that generates password on any file or folder in the hard disk.I want to start it from the scratch.
Can i get the help .I mean from where should I start.
Please help.
Thanks.
|
|
|
|
|
This is the second time you asked this question... Try reading the reply to the first one.
I take it you want to password protect any file or folder on the hard disk.
Basically, you have to have black-belt level knowledge of NTFS and how to write device drivers and file system extensions. This is because you'll have to intercept and process every single request to open a file, system wide.
VB.NET and C# are NOT good candidates for writing something like this. But, they are good for writing the management application you'll need to set/remove these passwords.
You'll also need to come up with some way of recovering a lost/forgotten password.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am working in migrating my cr application to 10th ver from the existing 8.5 where we have to explicitly make a query in query builder and then attach it. I was using dsn in ms odbc for oracle driver to connect the DB. Now in 10.0 i have removed the query file created using 8.5 query builder and trying to write directly to command editor. the report as stand alone is working fine. but when i try to generate the pdf using my vb application then on .export option it is giving error as "Logon failed.
Details: 01S00:[Microsoft][ODBC driver for Oracle]Invalid connection string attribute". i think the problem might be with cddb_oracle.dll or crdb_oracle.dll file as i am using a evaluation version of crystal report 10. as input to dsn i am providing
1.dsn
2.usid
3.database
4.password
what else is missing . plz help.....
prashant
|
|
|
|
|
I wonder if it is possible to have a string variable that has many "child values". I mean, is it possible to declare
Dim saved(i) as String
and then save different string values to saved(1), saved(2),..., saved(n)?
I have tried this, but without success.
I have declared string and an integer
Dim i as Integer
Dim saved(i) as String
Then I have a wrote a loop that adds 1 to i and then saves a value to the string variable:
Do
i = i + 1
save(i) = StringVariableX.SubString (0,i)
Loop
The error I keep getting is: "Exception System.NullReferenceException was thrown in debuggee:
Object reference not set to an instance of an object."
|
|
|
|
|
Yes, you can create an array of strings, but no, you can not hook up the number of items in the array to a variable.
When you create the array, the number of items is decided from the value that the variable has at that moment. Changing the variable afterwards doesn't change the size of the array.
If you don't know when you create the array how many items you need, use a list instead of an array.
---
b { font-weight: normal; }
|
|
|
|
|
I don't know how many items I need to save. Do you mean I insert a listbox or is there a variable class "list"? How to use it? How to retrieve a particular value from it? How to clear the list?
Thanks in advance!
|
|
|
|
|
In framework 1.x you can use the ArrayList class, which is a list of Object. In framework 2.x you can use the generic class List<T> to create a list of any type, for instance List<String>.
Use the Add method to add items to the list, the Item property to access the items in the list, and the Clear method to empty the list.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you! I'll try that.
|
|
|
|
|
hi
i have developed an application.i want to deploy it in a client machine,bt the problem is that i dont know how to make the crystal report database login information dynamic.can anybody help me in this regard to make the crystal report dynamic so that it can take the login information from the registry at the time of installation of the setup wizard?
how can i incorporate the microsoft.net framework in the setup along with the project so that it will automatically install the framework at the time of installation of projects?
any queries in this regard will be warmly solicited
i m pradip kumar from india,working in vb.net & asp.net
|
|
|
|
|
I wrote a somewhat simple User Control in VB.Net 2 which consists of only a TextBox and a Button. When using this control, how do I gain access to the textbox's TextChanged event? I'm not sure how to add the event handler to the user control so that is simply relays the textbox's event.
|
|
|
|
|
The event won't fire outside the control, nor is there built in support to bubble the event automatically. Your control has to handle the TextChangedEvent of its consituent TextBox control and in that handler fire its own event, passing the arguments it got from the TextBox. You'll, or course, have to declare your own TextChangedEvent in your UserControl.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
In the user controls class add
Public event TextChanged(sender as object, e as event args)
Under the textboxs normal event handler
eg
<br />
private sub TextBox1_TextChanged(sender as object, e as event args) handles textbox1.TextChanged<br />
raiseevnt textchanged(sender,e) 'Add this line<br />
end sub<br />
Now when the text boxs text is changed the event TextChanged will be raised.
It would also be possible to change this to:
Public event TextChanged(TheTextBox as textbox, TheText as string)
and
<br />
private sub TextBox1_TextChanged(sender as object, e as event args) handles textbox1.TextChanged<br />
raiseevnt textchanged(TextBox1,Textbox1.text) 'Add this line<br />
end sub<br />
So now you can also see what the text is and access the text box.
This may be a little over complicated but I dont call myself an expert but I hope this helps.;)
I'm not dumb I just have a huge command of thouroughly usless infromation.
|
|
|
|
|
Thank you for the insight, you've got me looking down the right path now, but I am still haveing difficulty getting it to work. Here are some more details on my situation...I actually have a user control derived from a user control.
The most primitive contro is called "FileFolderTextBox" and it's just a class that Inherits from System.Windows.Forms.TextBox. The contents of the text box is just a string that should be the path to a file or a folder, and if the text does not match an existing file or folder, the background color gets changed. Pretty simple, and that worked and is based on the TextChanged event.
The next control is a FolderBoxAndButton and a FileBoxAndButton class. Both of these classes Imports the FileFolderTextBox and simply adds a button that allows a user to select the file or folder.
Finally, I have a project that uses the FolderBoxAndButton class, and now I want to do something on the event that the text changes in the FolderBoxAndButton object.
So, in the FileFolderBoxAndButton class, I already have Private Sub FileFolderTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.TextChanged which changes the background color of the textbox. When I add Public Shadows Event TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) to the class and raise the event in my FileFolderTextBox_TextChanged sub, the event no longer fires (the background color never changes).
Am I just confused onwhat goes where or what am I missing?
And thank you for the help.
|
|
|
|
|
Hello, I have a CheckedListBox control on my form.The user can add items to the list and check or uncheck any item they wish. They can edit and remove items. This far, I am ok with the coding, however, when the form closes, I want all those items that are checked to be removed, but I am not sure how to go about this at all. I have tried a Loop unsuccessfully and attempted a for/next, however, i have made no progress. I also need to save all the non-checked items to a setting.
I am using visual studio 2005 (language vb.net). Any help would be greatly appreciated.
Posted by The ANZAC
|
|
|
|
|
As far as too remove the checked items this should do it
<br />
Dim CIs As Windows.Forms.CheckedListBox.CheckedIndexCollection = CheckedListBox1.CheckedIndices<br />
Dim UnCheckedItems As New List(Of Object)<br />
<br />
For CI As Integer = CIs.Count - 1 To 0 Step -1<br />
CheckedListBox1.Items.RemoveAt(CI)<br />
Next<br />
<br />
'As for saving the rest<br />
For x As Integer = 0 To CheckedListBox1.Items.Count - 1<br />
UnCheckedItems.Add(CheckedListBox1.Items.Item(x))<br />
Next<br />
You have to remove them in reverse order otherwise you will get an index out of range exception before the end of the loop or remove incorrect items (I found this out my own experience)
As for saving to a setting, in the example i've used a generic list to save the remaining items, which could be set up in a module or something
I'm not dumb I just have a huge command of thouroughly usless infromation.
|
|
|
|