|
lockepeak wrote: it is like Oicq or icq
These are not browsers, they are chat programs. You do it by writing client code, and server code. There is an example here on CP. Odds are you need to buy a book, and choose some more basic projects first.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi All,
I've been reading up on this and all the examples I can find show the exact method I'm using to read a value yet my value is never retrived. I'm checking the version of WMP installed on the system using:
Microsoft.Win32.RegistryKey wmpRegKey = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}");
string wmpVersion = (string)wmpRegKey.GetValue("Version");
as soon as the last line is executed the wmpVersion won't even pop up a debugger widget and wmpRegKey won't either.
Any Ideas?
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
using Microsoft.Win32;
//Statements (In your case)
//------------------------------
RegistryKey Reg;
//open the registry key
Reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}");
//get the requested values
if(Reg!=null)
{
string str1 = Reg.GetValue("Version").ToString();
MessageBox.Show(str1);
}
//close the key
Reg.Close();
//Regards
|
|
|
|
|
Hello
Is there a way to find out if any dataset is attached to a project
i.e. MyPoject.Dataset.count
Thanks
|
|
|
|
|
You'd need to keep that count for yourself.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for your reply,
i need to write a foreach loop for datasets, how can i write it?
foreach dataset in what?
Thanks again
|
|
|
|
|
Hi there.
I want declare method with optional parameters.
For example I want declare this method :
private void tree (string optional_parameter)
{
...
}
that I could call it like this :
tree();
Id est , I can omit optional_parameter.
Can we do it in C# ?
Sorry for my English. I'm a freshman .
|
|
|
|
|
|
C# doesn't support optional parameters. You achieve this concept by using method overloading.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
Just do as:
private void tree(params string[] optional_parameter)
{
if (optional_parameter.Length > 1)
throw new Exception("tree(): Invalid parameter count");
else if (optional_parameter.Length == 1)
{
}
}
Best regards,
Jaime.
|
|
|
|
|
Thanks , your answer was helpful .
Sorry for my English. I'm a freshman .
|
|
|
|
|
hi
i have a dataGridView and some textBox for each field, i want when i user double click on dataGridView, my controls bind to datasource that my dataGridView bound to, hitherto, it worked correctly and all row information display in appropirate textBox, this is edit mode, i want in this state, user can't change row until click ok or cancel info, but how to prevent row changing in datagridView ?
thanks
|
|
|
|
|
How do i dispaly the files and folders of a site in a tree view or simular format to windows explorer
Thanks
|
|
|
|
|
With a tree view control.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
In grid view Control,How can i represent a check box which is embed in the grid view.
|
|
|
|
|
I am close to certain there's a code project article on how to do this.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Hello everyone,
I am using the following code segment to check the status of a specific Windows service. My question is, if the service name does not exists, when we tries to get the Status property of the Windows service, there is InvalidOperationException. What is the elegant way to solve this issue (I have not found an API to check whether a service exists, and if I can check whether a service exists, I can check the Status property only for the service which exists)?
ServiceController controller = new ServiceController("not existing service");
try
{
if (controller.Status == ServiceControllerStatus.Running)
{
}
}
catch (InvalidOperationException ex)
{
}
}
thanks in advance,
George
|
|
|
|
|
You could use the ServiceController.GetServices() method to enumerate through all services and check if there is a service with a name that you're interested in. Or you could use WMI.
|
|
|
|
|
Thanks Zoltan!
Your solution works!
regards,
George
|
|
|
|
|
Hello everyone,
My application can be started as both console mode from main function and servide mode from OnStart.
My question is, is there any elegant way to detect whether the application is run under console mode or servide mode? Currently, I set a status in main function manually to detect whether it is run under console mode or service mode.
Any more elegent solution or built-in API I could use?
thanks in advance,
George
|
|
|
|
|
I use:
if ( System.Environment.UserInteractive )
{
}
else
{
}
|
|
|
|
|
Thanks PIEBALDconsult,
Great! I have tested that in console mode, the value is true and in Windows servide mode, the value is false.
Looks like even if my application does not have an user interface, like Windows Form, and my application is a pure console application, the property value is still true.
So the user interactive does not mean GUI?
regards,
George
|
|
|
|
|
I have a form with a DataGridView on it. I have an event handler for the MouseUp event. I am trying to make a context menu popup on a right mouse click only, and appear right under the mouse.
Here is what I have so far:
private void PlayList_CellClick(object sender, MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
Point loc = this.PointToScreen(new Point(e.X, e.Y));
int index = PlayList.HitTest(e.X, e.Y).RowIndex;
PlayListMenu.Show(loc.X, loc.Y);
}
}
It almost works, the context menu just doesn't popup in the right place. Any ideas?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I got it to work like this:
private void PlayList_CellClick(object sender, DataGridViewCellMouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
Point loc = new Point(e.X, e.Y + PlayList.ColumnHeadersHeight + (PlayList.Rows[0].Height * e.RowIndex));
PlayListMenu.Show(PlayList, loc);
}
}
Is there a better way? Know of the right way?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|