|
|
As Joshua pointed out, Double.TryParse is the way to go.
See this link for an example IsNumeric implementation using Double.TryParse:
http://www.tangiblesoftwaresolutions.com/Articles/CSharp%20Equivalent%20to%20IsNumeric.htm[^]
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter and VB to C++ converter
Instant J#: VB to J# converter
Clear VB: Cleans up VB.NET code
Clear C#: Cleans up C# code
|
|
|
|
|
Hi, I need to Run In My Form a Programe .
the programe need to Work under my form/
|
|
|
|
|
Hi,
Check the Win32 API for the "SetParent" command.
|
|
|
|
|
Thank you very mach...
and have a nice day.
|
|
|
|
|
Process[] procList = Process.GetProcesses();
It seems VS 2005 (maybe 2003 too) is buggy related to this code.
If I have opened windows already before I start my application , VS only show 1 of them. But if I activate a window, which isn't listet in the process array, VS finds it immediately. Anybody here with the same experience? Is "EnumWindows" from Win32 API the only solution?
|
|
|
|
|
Are you running this from inside the debugger or from within your own application?
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Both types, don't work with both ones.
|
|
|
|
|
What is Process , your variable or a framework class? (Sorry don't have access to my development machine).
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Process is the framework class.
|
|
|
|
|
Using the following code (.NET 2.0):
foreach (Process proc in System.Diagnostics.Process.GetProcesses())
{
Console.WriteLine(proc.ProcessName);
}
Creates the following output:
aswUpdSv
spoolsv
CSRSS
WINLOGON
MaxBackServiceInt
Apache
CTFMON
firefox
explorer
vsmon
inetinfo
htpatch
ApacheMonitor
rundll32
SMSS
LSASS
mstask
WinPatrol
svchost
SyncServices
SERVICES
acrotray
svchost
ashDisp
Apache
zlclient
Amoumain
SciTE
mdm
TSVNCache
WinMgmt
ashServ
css
System
stisvc
SharpDevelop
Idle
So I'm not sure what yours is doing. (I tried this with C# Script, article here by me). And also created a simple executable and both seemed to run fine. I havn't tried it from within VS (I don't have the full edition, only the Express, but I will try it when I get the chance).
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hello, sorry for my late answer. No, this code show only a single process. Try to open 2 or more SharpDevelop Instances and you'll see that you only get one of them.
In the meantime I found a solution. First get the ThreadID with the Win32 API and then get the ProcessByID, this works.
|
|
|
|
|
Seraphin wrote: Try to open 2 or more SharpDevelop Instances and you'll see that you only get one of them.
Nope I get all processes running as listed in the TaskManager
Seraphin wrote: First get the ThreadID with the Win32 API and then get the ProcessByID, this works.
Seems a long way around.
Try putting the following code:
using System;
using System.Diagnostics;
class ListProcesses
{
static void Main(string[] args)
{
foreach (Process proc in Process.GetProcesses())
{
Console.WriteLine(proc.ProcessName);
}
Console.Write("Press ENTER to continue...");
Console.ReadLine();
}
} Into a text file, name it something (like listprocesses.cs) then run csc listprocesses.cs to compile it and then run listprocesses.exe .
I just had a thought, are you running in a doman because maybe there's some security restriction in place which stops programs accessing other programs. Just a possibility?
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
hi
how to insert exe file into another exe file (or bind to exe file) and extract they when user click on my exe file ??
codeproject is best ..
thanks..
bye ..
|
|
|
|
|
One method would be to compress the application to reduce it's size (if that's a problem) and then encode the resulting compressed executable in a resource file as a Base64 string. To extract it reverse the process.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
I have a trailing CR or LF in my texbox2.text output from the following.
Any ideas on how I can remove that? (Also any regex help is appreciated.. It is a mystery to me)
p.Start();
sw = p.StandardInput;
sr = p.StandardOutput;
err = p.StandardError;
sw.AutoFlush = true;
sw.WriteLine("nbtstat -A " +textBox1.Text);
sw.Close();
Regex macaddy = new Regex("=(?<MAC>.+)");
string fred;
fred = sr.ReadToEnd();
Match m = macaddy.Match(fred);
if (m.Success)
{
textBox2.Text = (m.Groups["MAC"].Value);
}
else
{
textBox2.Text = ("No Mac Found");
}
|
|
|
|
|
kago512 wrote: Any ideas on how I can remove that?
How about:
textbox2.Text = textbox2.Text.Substring(0, textbox2.Text.Length - 1);
Since CR LF is (on Windows) the same as \n . If you're using WriteLine then you only need to remove the last character since, basically, .NET takes care of whether you're using \r\n or \n .
Regarding Regular Expressions can you provide some more help as to what your problem is.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
|
I Need To Run Program (EXE) and Display in my Form (project)
have a nice day!!!
|
|
|
|
|
([A-F0-9]{2}-){5}[A-F0-9]{2}
This Regex should work, at least it does for me.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Good day everyone,
I need to design and implement a Class Library project for the Heap data structure.
Is there anyone know where I can have a reference or a sample project?
If you're interested in, pls help.
Thanks so much.
eric
|
|
|
|
|
Wikipedia
K&R
Depending on what you want to accomplish and what operations are required it could be quite easy but then again quite hard, as with all projects.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hi.
How can I close right click on flash files, In code or in fla file itself ?
I have used flash player component.
Best wishes
|
|
|
|
|
How about asking an appropriate forum such as the Web Development. It's the more appropriate one and people there are more likely to have an idea on a solution.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hi
I need an example that read XML file and insert the data into
database (SQL SERVER )
thanks
eyalso
|
|
|
|