I'm trying to get a VB.net (express 2010) app to connect to a socket server (keeping the connection open), how would I go about this? Right now it works using flash XMLsocket, I'm trying to build a new client without flash, using the existing server.Currently I'm just using a simple window displaying messages, and a place to send messages.
It says I'm connected, but it displays no messages, and sent messages appear to have no effect, when I telnet to the server using the same IP and port, I can see messages coming in to me, so i know i can connect to the server. Here is my code:
Public Class Form1[code].......
I have not tested this, but I am fairly certain it would not work.When my program installs, I want to ensure that the default SaveFile directory is into a directory under the program's directory.For example, if the program installs to C:Program FilesConcept VisionsWorldFileMaker, I want the SaveFile dialog to default to C:Program FilesConcept VisionsWorldFileMakerWorldFiles.I can see in the File System of the setup project, under the property 'DefaultLocation', it's value is:
[ProgramFilesFolder][Manufacturer][ProductName]With Manufacturer = Concept Visions and ProductName = WorldFileMaker, am I correct in assuming this would be C:Program FilesConcept VisionsWorldFileMaker on a default Windows machine?
Below is the code I use to open the SaveFileDialog to save the file. The line in bold is the line I have my question about. How do I get the saveFileDialog1.InitialDirectory = "C:Program FilesConcept VisionsWorldFileMakerWorldFiles" without actually hard-coding it as "C:Program FilesConcept VisionsWorldFileMakerWorldFiles"? I want to use a substitution variable similar to "[ProgramFilesFolder][Manufacturer][ProductName]".
Eventually, I want to learn how to allow the user to install in a folder of choice. If I am correct, I would need such a substitution variable.
have the following code and would like to know how I can substitute the filename (i.e.,test.rtf) with the name of a Textbox. For example, I have several Textboxes that I want to add and associate individual comments to. That is, once the comment is created I will SaveFile with the TextBox name. Each of these Textboxes will have their own comment
Private Sub btnOpenFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenFile.Click
What I need to do is create comboboxes populated with values from a CSV for each class object selected from an Active Directory schema.
So lets say twelve classes are selected, the next form will display the class names in a checkedlistbox and will require twelve comboboxes for associating AD classes to CSV fields. Since the number of AD classes selected will always vary, is there a practical way to code it so that the objects can be instantiated from values stored in a variable?
Other languages support macro substitution, where the variable's value is interpreted as a literal at runtime. Developing in Visual Studio 2005, VB version 8 .netFramework 2.0xxx
Hi, I'm just beginning to teach myself how to do OOP in VB 2008 Express. I have a quick question after seeing a video online.Is a VB variable the equivalent of an 'instance' in Flash and a VB object like a 'symbol' in Flash? Is this what it means by a variable being a reference or pointer to an object and not the object itself?
When I right click on the component area, a contextmenu appears.I want to disable this OR remove "Settings" and "About Adobe Flash Player..".I searched the internet for a solution,but almost all the suggestions were about the Visual Basic 6. Anyone knows how to correct this in Visual basic 2008 ? (And sorry for my English if there is a mistake )
I am writing an application which involves reading xml over socket. The messages arrive at socket asynchronously. How can I ensure that data is received in form of complete xml elements, validate received data and which classes will be helpful for me in accomplishing my goal.
I have an application in vb.net which will connect with an hardware device and test its functionality. The hardware device basically spits out data continuosly through Ethernet. That is it recieves some data via com ports and spits out the processed data via ethernet.So my application does both. Thats pretty much the entire app.My problem is i am using tcpclient sockets. Now when i connect a tcpclient to the device using
Immediately the device sends some data which comes and get stored in the clientsocket. Then i send a command to it ,only then i read the data from the clientsocket using
at this time the entire data that is the one which flowed immediately when connected to the device and the one that i actually need after passing command is both acquired. This is undesirable. I need the data which i read only after sending the command. So i was wondering if there is any way to clear the tcpclient socket before we do a read. The manual doesnt show any such method.
I am using Nektra's Deviare to hook winsock's send method calls. My ideia is to learn to also send messages through the same socket than the original application. So what I'm doing is when i detect the first call to send message, I save the socket id(the first argument of the send function), so I can use it later.
So here is my code:
uint socket = 0; [DllImport("Ws2_32.dll")] private static extern int send(uint socket, string buf, int len, int flags);
This last messagebox is poping up always -1. Why should be it?
edit: calling WSAGetLastError() returns 2. Which I do not know what it means, as it doesn't seem to appear on msdn.
i am using vb.net and i would to send some structs to a C++ tcp server.The problem is the structs i am sending might contain other structs.[code]Lets say i want to send FirstStruct over to the C++ Server.
I am actually new to VB.net...i have managed to create Sockets and communicate over them..but i dont know how fire sql queries through sockets as they take in Byte data as a input...i want to actually pass queries through sockets and retrive those results...i am using mysql database....i have actually tried changing the connection string (the ip address) for a static network but i think sockets are better for dynamic ip networks.
I have a chat program using System.Net.Sockets.Socket that works perfectly over LAN.My question is - will this same program work over the net with little or no modification and if so do i provide the client with the IP of my machine or of my router and use port forwardin
I'm using System.Net.Sockets namespace for connecting to an ftp server. If a user has to login to a firewall first though, I'm not too sure what to do. The following is what I have working for logging into an ftp server without a firewall. (The Else statement) Do you know what I might add to the if statement? In the method where this conditional is, I am passing a firewall username and password.
m_tcpClient = New TcpClient ' Try to connect to ftp site ' If using firewall, login to it first then issue another command to log in to actual
I made a TCP server which communicates with multiple clients at once, but I can't seem to be able to make them stable. When one of the client sends 100 packets to the server, the server receives only a few of them.Here's the client code in PasteBin. It shows how the client connects to the server and then sends 100 messages in a For loop to the server.And here's how the server handles the connection. I couldn't paste the full source as it's hundreds of lines long so let me know if it's missing any mandatory parts and I'll upload them as well.
Basically in my main application i am instantiating the client class from this dll, as well as the server one. On the client form i got a "send data" (SendFISA sub) and a "connect" button. After connecting the client and clicking on the "send data" i am sending to the server a string formed of some information created when instantiating the client class from the dll (i can't make that type of data public, but i'm just using a constructor to assign values to a class object, nothing special).
Now, when the server receives the data sent by "send data" button click it responds with "PKG_SENT" corresponding to the "FISASENT" string terminator(in the module) of the string that was sent. The "WRONG_MSG" constant is for when the string terminator is different from the 2 from above.
On the local disk, if the server cannot be reached, the client saves an xml file with this data. In the dll i made a timer that ticks every 5 seconds and checks to see if there is any xml file on the disk and sends it to the server if the connection is ok (trimiteXML sub). The server would respond with "XML_SENT" corresponding to the string terminator "XMLSENT"(in the module) appended to the read string from the xml file. After the file is sent it is deleted from the local dir.
The problem occurs when i click "send data" AND there are XML files to be sent from the disk. I believe they are interpreted by the server somehow at the same time because the message is neither "PKG_SENT" nor "XML_SENT", but it becomes a combination of the "WRONG_MSG_TYPE" and "XML_SENT", "XML_SENTG_TYPE". I have no idea why this is happening and i basically want the socket to wait with sending the files from the disks until the "send data" finishes.
I'm constantly trying to improve my coding abilities. I'm trying to learn the ropes on using .NET Sockets but everything I'm finding it pretty cheesy and doesn't really go over the details of what each piece of the code is about.Can anyone point me to a great tutorial or site where I can get started?