|
I'm using VB in VS2005 on a WXP SP2 machine to build a windows service that listens to a port to accept messages. This solution works fine when a connecting client sends a message, waits for an ACK and disconnects. We now want the socket to remain OPEN after sending the ACK, which it used to do on beta2 and older machines.
Does anyone know which property to set or another solution to keep the socket open after the send.
Any ideas?
Bert Maes
Here's the code:
Public Sub StartGateway()
CommServerListener = New TcpListener(IPAddress.Parse(HostIpAddress), CommServerUnsollicitedPort)
CommServerListener.Start()
Timer2 = New System.Timers.Timer(1000)
Timer2.Enabled = True
End Sub
Public Sub Timer2_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer2.Elapsed
If h.CommServerListener.Pending() Then
Timer2.Enabled = False
ProcessCloverleafRequest()
Timer2.Enabled = True
End If
End Sub
Public Sub ProcessCloverleafRequest()
Dim Buffer As Byte() = New Byte(TcpBufferSize) {}
Dim NumberOfBytes As Integer
Dim Temp As String
Dim msg As String
Dim iStart, iEnd As Integer
If ListenerSocket Is Nothing Then
ListenerSocket = CommServerListener.AcceptSocket
End If
Temp = String.Empty
If ListenerSocket.Available > 0 Then
ReDim Buffer(ListenerSocket.Available)
NumberOfBytes = CInt(ListenerSocket.Available)
ListenerSocket.Receive(Buffer, Buffer.Length, SocketFlags.None)
If NumberOfBytes > 0 Then
'....do stuff
'when finished echo message
ListenerSocket.Send(Buffer, 0, Buffer.Length, SocketFlags.none)
'Here one would expect that this instruction doesn't close the connection
'anyway the connection should stay open
End Sub
|
|
|
|
|
I have been developing a web site using VS.Net/VB.Net. And I now have a fairly big site. Is it possible to put them in a format that is viewable outside of the C:\Inetpub\wwwroot folder?
Like would it be possible to compile it in a manner and email it to people? Because I don't want to put it on the net.
|
|
|
|
|
Is it possible to put IIS on a cd and run a web page from a cd?
|
|
|
|
|
you won't need to put IIS on a CD..
just copy it onto a CD.. assuming that you copy across all custom dll's etc
it will work on any machine that has .net framework installed on it
Simon
|
|
|
|
|
How do you mean "Copy it across"?
And how would I get it working on a machine that doesn't have the .net framework installed?
|
|
|
|
|
It doesn't work without the net.framework. It shouldn't be a problem, it's a free download.
|
|
|
|
|
actually I just read somthing about a thumbdrive with a full appache server on it. works on most any PC it's plugged into. nifty
hey...slang is the vernacular for the vernacular...wow
|
|
|
|
|
I am working in visual basic and trying to find how to take a date that is provided in international date format (ie 05.05.06) and convert it to another international date format (ie 05/05/06). The problem lies both in the delimeter differences and the mm/dd vs dd/mm formats. Has anyone done this in VB? I need to be able to convert from one format to the current regional setting, but I may not know what format the incoming date is in.
|
|
|
|
|
hi every body.i use (Mscomm32.ocx)ocx from vb6 to vb.net 2003.but when run my application display message ::
{An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in modemApp.exe
Additional information: COM object with CLSID {648A5600-2C6E-101B-82B6-000000000014} is either not valid or not registered.
}please some body help, please example
123
|
|
|
|
|
dude, kool it on the dup posts.
that said,
to register an ocx, use the regsrv32 command in the shell.
running command strings in VB.net is pretty easy, with teh shell verb
dim x as string = "regsrv32 mscomm32.ocx /s"
shell(x, -windowstate-, -wait-, -timeout- )
you can add this code to the install package by overriding the Install method. there is a great tutorial on this site about "Conditional Installer packages" that discusses how to do just that, so you can ask where to put desktop and quicklaunch shortcuts. it's pretty good.
Good luck
hey...slang is the vernacular for the vernacular...wow
|
|
|
|
|
hi every body. i need to help.
i use (Mscomm32.ocx)ocx from vb6 to vb.net 2003.but when run my application display message ::
{
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in modemApp.exe
Additional information: COM object with CLSID {648A5600-2C6E-101B-82B6-000000000014} is either not valid or not registered.
}please some body help, please example
123
|
|
|
|
|
hi every body. i need to help.
i use (Mscomm32.ocx)ocx from vb6 to vb.net 2003.but when run my application display message ::
{
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in modemApp.exe
Additional information: COM object with CLSID {648A5600-2C6E-101B-82B6-000000000014} is either not valid or not registered.
}
please some body help, please example
123
|
|
|
|
|
i need to mscomm32.ocx (from vb 6)
123
|
|
|
|
|
Hi,
I have a table called tblUsers that displays all my users. What I want to do is when the user launches my form, for it to say Welcome "userloginName" on a label. So my form has to check to see if it is a valid user against (tblUsers).
How can I accomplish this?
Thanks,
Rashar
|
|
|
|
|
In VS 2005 you can use My.User.Name to retrieve the current user id.
Lost in the vast sea of .NET
|
|
|
|
|
Hi Thanks.
That works nice. However, when I debug into the code, the value of My.User.Name shows me domain\username, Where I just want username.
Is this possible?
Thanks,
Rashar
|
|
|
|
|
Try this:
'String manipulation to split the domain and userid<br />
Dim strFullUserID As String = My.User.Name<br />
Dim strUserIDSection(1) As String<br />
strUserIDSection = strFullUserID.Split("\"c)<br />
strDomain = strUserIDSection(0)<br />
strUserID = strUserIDSection(1)
Lost in the vast sea of .NET
|
|
|
|
|
in 2k3 I always used system.environment.username
which returned just the short name.
or you coul djust substring the returned name since that convient "\" is a perfect dilimeter.
dim y as string = system.environment.username
dim x as string = y.substring(y.laastindexof("\") + 1, y.length)
good luck
hey...slang is the vernacular for the vernacular...wow
|
|
|
|
|
FrankyT's post made me think... I tested the following in VS 2005 and received the results shown:
MsgBox(My.User.Name)
The messagebox displayed shows: COMPANY_DOMAIN\jsmith
MsgBox(System.Environment.UserName)
The messagebox displayed shows: jsmith
MsgBox(System.Environment.UserDomainName)
The messagebox displayed shows: COMPANY_DOMAIN
Much simpler code than what I posted earlier.
Hope this helps!
Lost in the vast sea of .NET
|
|
|
|
|
i need to pass parameter to another application built on C language with exe extension , i need a demo file describe the answer of my Question, i am making a project with VB.net language and i faced problem while i sending parameters to C application ...
i know how to send parameter to Prompt (consol.write) but to C Application application ...
i wait your answer .....pls
kilany
|
|
|
|
|
System.Diagnostics.Process.Start("your_program.exe","parameters")
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi
I have a winform in vb.net and I want to print it (as is)...
I searched the internet for some code, all of which demonstrate using Graphics.DrawImage and BitBlt API to draw an image of the form to the printer more like PrintForm method in vb6. But as you know, there are lots of limitations.I must make my form fit on an A4 paper.
Could you please introduce me some references on printing a form, using standard .net method.
Thanks
|
|
|
|
|
hey guys can you help on how to select the item in "ListviewItem.subitem" i set "LabelEdit = True" and "FullRowSelect = True" but still i can't edit the text....
thank you!!!!
|
|
|
|
|
Hi,
When the LabelEdit property is set to true, the user is able to modify the text of an item by clicking the item text to select it and then clicking the item text again to put the label text into edit mode. The text of subitems cannot be modified if this property is set to true. To change the text of subitems, you can display a dialog box to users when they double-click a subitem in the control.
http://msdn2.microsoft.com/en-us/library/system.windows.forms.listview.labeledit.aspx[^]
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time. The answer is out there.
|
|
|
|
|
Hi
I installed directx 9 SDK but when I'm opening a 'directx 9 visual basic wizard', I get the message "The .NET assembly 'Microsoft.DirectX.dll' could not be found"
Could you help me!
thanks
|
|
|
|