.net - Formatting And Sending Client Messages, Use Of XxxService Classes?
Jun 21, 2011
Need some advice on class design. I've just started to use xxxService classes, so not really sure when and how to use them. A number of (identical) client applications connect to this program with socket TcpClient. Different type of messages needs to be sent from several different classes. Should I call a service class, with static methods, whenever I need to send some message (like code below suggests), or should I rather raise an event, and have some class registered to those events, that will format and send the messages.
That would kind of hide that sequence of events from these classes, but on the other hand, it would be a centralized class where one can see easily all events that trigger a message send. Which feels like a benefit. Would like to hear some advice on this. And if my last suggestion makes sense, what could such class be called, and would it be considered a ..Service class?
Example: (code is a bit "rough")
Class UserConnection
tcpClient As TcpClient
Public Sub SendMsg(msg as String)
[code]....
View 1 Replies
ADVERTISEMENT
Mar 15, 2012
i have several clients on a LAN network, these clients all have access to a particular sql server. i want to write an application that allows any client on the network to send one or more messages to another client on the network providing that both clients have access to the specified sql server.
View 1 Replies
Dec 9, 2011
I am trying to add functionality to an existing program that can send a message from a Windows XP and Windows 7 computer to a group of computers that are running XP and Windows 7. Previously I was doing this with Net Send but as we are no purchasing
Windows 7 machines when we need to replace old computers, that is no longer an option.
I would prefer to have the message appear as a popup on the receiving computers as this is for calling for assistance from a supervisor or the QC department and they will not have to send a response.
View 3 Replies
Apr 18, 2009
I'm working on a program that detects any keyboard or mouse activity, and sends a message through the MSN (or Windows Live Messenger) protocol. The mouse and keyboard thing should be fine, but I don't know how to send messages through the MSN protocol.
View 3 Replies
Mar 14, 2009
I was Wondering How Would I I Make A Program or a port That will connect with my friends computer...and I can send Him Like message box and stuff..
View 1 Replies
Jan 5, 2009
I have made a app that allows me to keep track of when bills are due, it allows 8 bills and dates to be entered and once the time hits a specified time of day and the day that the bill is due it sends a text message to my phone, it works fine if only one of them are enable but if 2 are due the same day it seems to only send the first on that completes the if statement i made heres my code, the timer is set for ever 1 second tick (otherwise it sends multiple texts of the same bill due) This is the first 2 of the bills but the other 6 are the same
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim mto As String
[Code].....
View 2 Replies
Sep 5, 2011
A little while back, someone asked the question "How can I send an SMS text message via a VB program?", and it's not the first time that I've seen this asked. I thought, as a little side project (mainly just to get my head away from 'real work' for a while). Of course there are several ways this can be done, including the use of a GSM modem, but this only focuses on one aspect: Sending an SMS message via e-mail.
Rather than clogging this forum with a lot of code and screenshots, I've put it all together on my site.
View 4 Replies
Jan 15, 2009
I'm in a programming class, and I need to make a game. Is there an easy way I can send messages, like "w" or "down", between 2 computers so I can have a multiplayer game?
View 1 Replies
Aug 22, 2008
I was woundering if it is possible to send messages over network to a lan computer . if it is possible does anyone have the code to make this possible
View 2 Replies
Dec 5, 2009
I was looking for an easy way to send Messages to other Applications on the same computer. Something simple like "SendMessage("MySecondApplication",WMI_USERS,"MESSAGE").
View 1 Replies
Oct 29, 2011
I'm realizing a .NET chat application but i still have that error: I can send only a message per connection. For example. With the code below, i can send only one message that can be received correctly by the other peer, but if i send another message message, on the same connection,it won't be received by the remote PC. Here is the code:
[Code]...
View 1 Replies
Mar 11, 2009
All,I am trying to implement something so that my VB can be able to send/receive SMS messages to cell phone(modem). I tried researching a bit and found out that we can use MsComm control to do this but it is not available in Visual Basic express 2008 edition. Can we use serial port class to do this? If yes, how could we implement this?
View 2 Replies
Oct 7, 2011
I want to develop an application on below conditions.
1) I will have the database of all the systems on the network.
2) Only messages can be sent from Server to client.
3) When a message is received on client it should give a poup like our antivirus/ tool tip like thing.
4) This application should run on all the systems in background and in task-bar with an icon. PBL
View 2 Replies
Nov 19, 2009
How would I create a multi-tcp chat room. Im having trouble handling them. I know you can store the connections as arrays or store then in hash tables. Is there a better way to data to a specific connected client. My way was to just broadcast the message to all the connected with the clients name (EX: Client1||MessageHere) || is the split. The client reads the message and sees if client name matches if it does then it will display it other then that it will not. I found out that my server was sending out useless data with this method. So is there a better way to handle/Send messages to a specific client?
View 2 Replies
Jun 28, 2010
I'd like to create one as I am an affiliate marketer who wants to reach customers based on key words. I don't regard this as spamming since I'm not randomly sending out links its based on key words like I said. Y!A might regard this as spamming anyways but so what. In Yahoo Answers you click the question you want to answer, type in the answer, it takes you to a preview screen, and then you click submit. I suppose the script/program could involve automating this task.
Its not that I need everything to be done when I'm away from the computer, I don't mind working the program at all each time I send a mass amount of messages. Someone created a program a while back that was *supposed* to send bulk messages as they stated in the description but as it turned out this was not an option you could only comment on resolved questions. When I did send mass comments to questions which related to my key words, I clicked the link to confirm my comments went through and they did not! This program was a waste of my time and energy but that's life.
View 1 Replies
Mar 4, 2010
I'm looking for some sample .NET code that would show how to send text messages to pagers. I have no problem with sending text messages to cell phones, but could not find how to do the same for pagers.
View 1 Replies
Apr 15, 2009
I've been working on this personal project of mine and this has me stumped. I told my friend what i was trying to do and hes going to let me use his mail server that he uses at work. I have already looked on google for a sample application, but the only one i could find is not the one im looking for. Ive never worked with System.Net.Mail before so this is new to me. Im sure it would be something like this:
Imports System.Net.Mail
Dim toPhoneNumber As String = "DestinationPhoneNumber";
Dim login As String =
[code].....
View 2 Replies
May 10, 2012
I am using Peter Huber's POP3 client to connect to gmail and download messages.The inboxes being accessed are transactional inboxes used only for code-access. That is, a message comes in with a order file attached, code will process it and then delete the message. One stipulation of the code though was a DEBUG flag, which if set would prevent the code from deleting the message so that you can run the program again later without the debug flag and reprocess the message. So, in my code I have If Not Arguments.Debug Then pop.DeleteEmail(eid)
This works fine. Problem is, even when not deleting the message, running the program a second time will not re-retrieve the message, even though if I login to gmail and look at the inbox, it is still there. The only way I can get the program to see the message again is to forward the message back to the same inbox. But in Peter's code I do not see anywhere where he is keeping track of seen messages between sessions.
Is this something that is done on gmail's end? Refusing to deliver a message to the same client a second time? If so, is there any way I can change my gmail account so that it will always show all messages in the inbox to a client when retrieving the list of messages, even ones already "seen"? I don't see anything in the gmail settings screen.adding a method to send a RSET command to the server, as per this comment on the codeproject page.
View 1 Replies
Dec 14, 2010
Quote:
Dim conReader As New StreamReader(con.GetStream)
Dim conCont As String = conReader.ReadLine
It just reads the first line of the server I'm trying to connect to, I want to make it read all the messages that the server is sending. btw, con is: Dim con As New TcpClient
View 8 Replies
Jun 5, 2009
I'm trying to make a LAN IM client using the net send command and I was wondering if there is any way to capture the text of the messages received through net send and display them in a label.
View 6 Replies
Feb 13, 2012
while making my irc bot i need to send many different irc commands such as join channel, change mode, kick user message, topic channel message and so on. All these commands are currently process individually in a public sub on the irc connection thread.
Public Sub Write(ByVal command As String)
_streamWriter.WriteLine(command)
_streamWriter.Flush()
[Code]....
Would you have a load of public sub's to handle each or maybe something else?
View 2 Replies
Feb 20, 2009
I have recently written a few TCP Client/Server classes for an application. The main thing I am worried about is if the server class is built efficient enough; I don't have any previous experience with tcp networking so I need someone to give constructive criticism and feedback on the design. I'll explain the server design below.At the very bottom of my framework is a ServerClient class, which is pretty much a TCP client with some extra methods, properties, and events. Each ServerClient continiously read for packets, once one in received, they raise a packet received event... this will come in later on.
The actual server class is simple, it uses another thread to endlessly loop waiting for connections. When a connection is found, it converts the TCP Client into one of the above ServerClients then adds event handlers for the packet received and disconnected events. Finally, it stores the newly created ServerClient into a hashtable with all of the other people who are connected to the server.
When a packet is received by one of the ServerClients it is forwarded to the server(because the event handler was set when the connection was established) and then in turn forwarded onto the application with the sender's ID.Just a brief overview, I'm not attaching any code because I don't like doing that. If you want to see it then send me a PM. I'm just looking for constructive feedback on the design; will this system work, will it scale with a lot of users, and how do large servers handle so many clients at one time?
View 6 Replies
Jun 11, 2011
i want to send multiple screenshot images from my client to server.. now i already get the screenshot code.. and the only problem i have is that .. i can't send them in my server..
View 2 Replies
Jun 15, 2010
I am new to VB.net and struggling to get out of VB6's way of sending data, I am doing this to send a byte array from my client to server, please advice if this is the right way,The sending portion:
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim arrNo(3) As Integer
[code].....
View 2 Replies
Oct 13, 2010
I'm not sure what I have done wrong, I am trying to get my program to send data (UsernamesPasswords) from client to server, then the server says if it's right or wrong.
The error is on this line:
Dim networkStream As NetworkStream = TcpClient.GetStream()
Heres the Client:
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then
MsgBox("You must enter UN/PW!")
[Code] .....
View 4 Replies
May 16, 2012
I have a Client/ server application where the Server is in java and Client is in Vb.net.When i send large string from client to server am not receiving complete text.code attached below.
client-- VB.net-
Try
Dim clientSocket As New System.Net.Sockets.TcpClient()
[code].....
View 1 Replies
Mar 24, 2010
As some of you may know, I'm trying to develop a client/server application that requires sending files and text. Text is not a problem, this works fine, and for some of the part, sending files works, but they get slightly mangled in the process. For example, I used a 4x1 BMP that was alternately coloured red and white and tried sending it across. The output was the correct image dimensions, but the colours were wrong. It was more like a very dark red and very dark grey. I inspected the files with notepad, and the header was the same, but the data was different.
I did some research and apparently need to use a BinaryReader and BinaryWriter as opposed to reading the data as a string (like I was when it was being mangled) but now the data is all wrong, even filesize is different.The code below is a simple example of code for reading an image and then writing it again elsewhere using Binary Read/Write.
[Code]...
View 4 Replies
May 13, 2011
Mail.From = New Net.Mail.MailAddress(test@gmail.com)
Mail.To.Add("exc@gmail.com")
Mail.Subject = "Test"
[code]....
View 1 Replies
Dec 10, 2011
I want to use spy++ or Winspector But from what i Read they Dont work on windows 7 64bit Correct ? Im trying to read WM_COMMAND Messages from a App.And whenever i Select 'Log Messages' And find the windows etc.Nothing show's up. Is there a alternative ?
View 3 Replies
Sep 24, 2008
here I am again I have written a small class called 'Messages' that holds the user messages.The case is that I am not being able to import it. Here it is:
[Code]...
View 4 Replies