|
hi there,
i have a problem in conversion string to single, two textboxes have some alphabets and numerical values too
i want to comparision between them so i coded but its giving error
The error is: Input string was not in a correct format.<br />
Dim z, z1 As Single
z = Convert.ToSingle(zc.Text)
z1 = Convert.ToSingle(zc1.Text)
If z > z1 Then
MsgBox("It can not greater than other z")
zc.Text = ""
ElseIf z < z1 Then
MsgBox("It can not less than other z")
zc1.Text = ""
End If
someone know the solution
|
|
|
|
|
wow - that's some real world code if I ever saw it.
use Single.TryParse. Why is your data of type Single ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
mmm... some numerical values and alphabets , they can be in points
i just need numbers
|
|
|
|
|
OK, so you're saying that your problem is that you need to sanitize your data first ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yeah, can you please stop questioning???? and let me know the solution???
|
|
|
|
|
Well, gee, if you made yourself clear, I wouldn't be asking you these questions.
Again, the TryParse method is the way to find out if your data is a number or not. If you want to find a number in your string, you can use a regex to find the number within the string, or you can use the split method on the string class, if the noise is always the same.
If that doesn't help, you need to explain yourself better. Probably with examples of the data you're dealing with.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
my one is communicated in one computer,use common IP Address.but server side canot display message in Listbox.so now i can use method to display message in it.thax
-- modified at 9:15 Thursday 26th April, 2007
|
|
|
|
|
braleping wrote: Just communicated in one computer
??????
braleping wrote: but my server cannot display message in List box from client side
How did you implement this communication? Sockets? Remoting? RPC?
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
communication under the Windows.so use common IP Address"127,0,0,1".i think it isconnect in Remoting.
|
|
|
|
|
This tells me you have code that sends a message between your client and server, but you don't have a single clue how how it works or what you used. How am I supposed to explain what you should be doing if you can't tell me what you're using?
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I am never use Winsock and any components,in my server side i just put one Listbox,timer and "Start"buttoon.that's all.i want to know use AddHandler,Event Handler,raise Event can solve my problem?if not this,what i should be use to solve problem?thax
|
|
|
|
|
I am never use Winsock and any components,in my server side i just put one Listbox,timer and "Start"buttoon.that's all.i want to know use AddHandler,Event Handler,raise Event can solve my problem?if not this,what i should be use to solve problem?thax
|
|
|
|
|
communication under the Windows.so use common IP Address"127,0,0,1".i think it isconnect in Remoting.
|
|
|
|
|
i think connected in Remoting,because use common IP Address"127.0.0.1".how to solve my problem?
|
|
|
|
|
Right now when I drag a .jpg file onto my program icon on my desktop it starts the program. How do I capture the filename so I can load it into my form on startup?
|
|
|
|
|
It has been many years since I did this... Isn't it passed as a command line argument to the application?
|
|
|
|
|
I believe it is a command line argument. The problem is how do I pick it up once my app starts. What is the command to access it?
|
|
|
|
|
From the Main method (all applications have one - unless VB is different) which will be on your Program class (in VS2005).
Alternatively, from anywhere else in the application:
Environment.GetCommandLineArgs()[^]
|
|
|
|
|
Colin,
First, thanks for your help. When I drag my file on top the the program it starts and I can read the arguments, but it only lists the executing program. The file I drag onto the program to start it is not listed. Any ideas?
|
|
|
|
|
I've just tried it myself. It works for me. If I drop a file onto the shortcut on the desktop, it will have the file name as the second argument (ordinal position 1) in the array.
|
|
|
|
|
This is what I am using:
Dim arguments As [String]() = Environment.GetCommandLineArgs()
For i As Integer = 0 To arguments.Length - 1
MsgBox(arguments(i))
Next
I drag the picture on top of the program shortcut and only get the executing program. Does the above code look correct?
|
|
|
|
|
Well, it should work. I used a For Each in my test, but it should be at arguments(1)
bendbock wrote: I drag the picture on top of the program shortcut
When you say you drag the picture. Do you mean the icon of a file in explorer? Or a picture from a running program? (e.g. A bit of clip art in power point)
|
|
|
|
|
|
C#
public class MyList<T> : IEnumerable<T>
{
public IEnumerator<T> GetEnumerator()
{
//DoSomething1;
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
//DoSomething2;
}
}
How to change the C# code to VB.net source?
Thanks!
|
|
|
|