|
I have a problem regarding my tcplistener. I went to MSDN to get the example for tcplistener and found out that it listen to character by character which is not wat i wan. Is that a way whereby i am able to read the client request as a sentence and not character??
|
|
|
|
|
The TcpListener object merely listens for connection requests. When a connection request comes in, you can either use that as a trigger (Which I have done for some purposes), or you can issue an AcceptTcpClient to create a TcpClient object for transmitting information back and forth.
Additionally, the TcpListener object does not have events and you "should" have it configured as a listener thread that simply loops and checks for connection requests.
I don't claim to be a know it all, for I know that I am not...
I usually have an answer though.
|
|
|
|
|
I am trying to limit the length of text that a user can enter into a text field in a propertygrid. I really prefer not to have to add a form with a textbox and a button to accomplish something that should be so simple. On an ordinary textbox, you can easily set this, but not when it is in a propertygrid. I have spent several days searching for ways to do this, but have been unsuccessful. I tried to add a class that inherits from a textbox and set it that way, but when I run the application, I can not type anything in the field.
Thank you for your time (and hopefully willingness to help)
Nick
|
|
|
|
|
I've only used the property grid a couple times. I created a class with exposed properties and set the propertygrid.selectedobject = to the class.
In the property's description (displayed at the bottom of the property grid), could state "The length should be between x and xx amount of characters". In the property set statement, you can then check the length prior to setting your variable = value and display a messagebox if the length is outside your required range.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
How do i specify path to a file on another computer on the network
thanks
|
|
|
|
|
you have 2 ways:
\\terminal id\folder/share name
\\ip address\folder/share name
you obviously need security to do the above...
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
|
If you are in a windows application, there is no cache. Read about Singleton pattern and how it is implemented.
If you are on an ASP.NET application, you can use cache("name") = YourArray . But then you are in wrong forum. Try ASP.NET forum.
|
|
|
|
|
yes i am in windows application in vb.net but i am not success in store array in catch memory plz send some code for use cache memory.
thanks
Vineet Swami
Isol
|
|
|
|
|
I'm pretty sure this is completely controlled by your computer's hardware and you cannot directly tell your computer to cache something in any programming language. Bascially cache is relatively small so your computer has some algorithms that generally move the part of your program that is in use into the cache and move it out when it is not. This works more than 90% of the time so I wouldn't worry about it too much.
There are ways to indirectly affect cache hit rates and make your program slightly faster but since you are a begginer I would recommend you learn how to use the language first and worry about making your program fast later (assuming it is not fast enough already).
|
|
|
|
|
Yes, such an optimization should be really subtle.. If speed is so important to you, use C++ instead of .NET.
|
|
|
|
|
Try looking for Enterprise Libray Caching on the Microsoft site - they have a load of ready to use blocks - probably over tbhe top for what you need, as I suspect all you are really looking for is a method of only reading the data once. Try googling for 'shared' (VB) or 'static' (C#)
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Dear All
i am trying to send email using vb.net i am using this code and on my PC it's OK but on others not,
the point is the outlook account created on that PC for a Gmail account and i need to send it using the smtp server on another account i tryed to use the property "omsg.SendUsingAccount" can any one help plz
Dim oApp As Microsoft.Office.Interop.Outlook.Application
oApp = New Microsoft.Office.Interop.Outlook.Application
Dim oMsg As Microsoft.Office.Interop.Outlook.MailItem
oMsg = CType(oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem), Microsoft.Office.Interop.Outlook.MailItem)
oMsg.Subject = "Hello!!!"
oMsg.Body = "Hello World"
oMsg.To = "zzzzzzz@zzzzz.com"
oMsg.Send()
|
|
|
|
|
I think you should looking for this.[^]
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
thanks
but i am dealing with a smtp using exchange 2007 this is why i am using CDO1.2.1
modified on Monday, October 20, 2008 9:39 AM
|
|
|
|
|
If you're connecting to Outlook (at client side) using CDO, the client must have both Outlook and CDO installed. I would guess that the non-working PC is missing the other one.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hi,
When I use this internal function my program automatic create a folder for the use of the program. Thats fine, but it also create a subfolder with the version number. Is there a way to avoid the creation of the subfolder?
I use this code:
sFile = New IO.DirectoryInfo(Application.LocalUserAppDataPath).Parent.FullName
I use now the parent becourse I dont need that subfolder!
Jan
|
|
|
|
|
Your post is confusing. Try this method instead:
my.Computer.FileSystem.CreateDirectory(strYourDirectoryPathHere)
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
The way you suggest is create the folder yourself.
with Application.LocalUserAppDataPath the system automatic locate the correct place on the harddisk. On my PC it is:C:\Documents and Settings\UserLogin\Local Settings\Application Data
and then CompanyName\ ProductName\ ProductVersion
The variable sFile is of the type string. Later in the program I add the filename and I open that file with an xmlreader.
I know some (strange) persons who change the doc & set folder. So the program must also work for them
|
|
|
|
|
You can use Environment.GetFolderPath[^] to return the path to the Application Data folder. From there, you can create your own company and application subfolders and use that path as the root for your data. This is the same method Application.LocalUserAppDataPath uses as a base path to build the userdata\Company\Application\Version path that it returns to you.
Keep in mind that there are TWO app data paths. The one you're using returns the data path for non-roaming profile users. The Application.UserAppDataPath method returns the app data path for romaing profile users. Environment.GetFolderPath will also return those same paths, depending on which SpecialFolder enumeration value you use.
|
|
|
|
|
Thanks all.
I'll give this a try.
Jan
|
|
|
|
|
you could use:
my.Computer.FileSystem.GetDirectoryInfo(system.Windows.Forms.Application.LocalUserAppDataPath).Parent.FullName
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Good Morning!
I have a program developed in C, but the main application was made in Visual Basic. Is there any way of accessing C functions from Visual Basic?
My best regards.
|
|
|
|
|
ajorge2008 wrote: Is there any way of accessing C functions from Visual Basic?
Visual Basic or Visual Basic .NET ?
You need to export your C functions to a DLL. Use P-Invoke to access that in your .NET application.
|
|
|
|
|
Hello guys,
in my search for a solution integrating an ActiveX Object I received a code snippet for a class to convert the IPicture format first:
Private NotInheritable Class myClass
Inherits System.Windows.Forms.AxHost
Public Shared Shadows Function GetPictureFromIPicture(ByVal picture As Object) As Image
Return AxHost.GetPictureFromIPicture(picture)
End Function
End Class and I should use it like
Dim pic As Bitmap = MyClass.GetPictureFromIPicture(GflAxObj.GetPicture) The first trap I run into is that obviously VB requires "a private type to be within another type" (hope it's translated good enough from my german version that you understand what I mean). I have no idea what's meant and can't find any hints in the help files and internet...
Trying to make the class public VB tells me it would require a "sub...new" with reference to mybase.new and it's parameters. But this fails because I don't even know which parameters I might have to use.
One more: The last line in the code snippet "Dim pic as ..." refers to the ActiveXObject as "GflAxObj", but I can't see where it is defined. I'm afraid this would be one of the next traps.
Could someone please give me some guidance through this?
Thank you very much
Michael
|
|
|
|