|
I don't know any .net way too, but you can use SetTimeZoneInformation() win32 function.
Mazy
You're face to face,
With the man who sold the world - David Bowie
|
|
|
|
|
Thanks for that, would it be possible for you to provide an example of its use as I am a newbie to p/invoke?
CyMad
CF Developer
|
|
|
|
|
Search for DllImport in this site and MSDN and you will get lots of sample.
Mazy
You're face to face,
With the man who sold the world - David Bowie
|
|
|
|
|
Thanks for your help?
All working now
CyMad
CF Developer
|
|
|
|
|
.NET is a high-level framework (seemingly till "Longhorn") and is not intended for such use (just like you can't set the system time or display characters, etc.). Mazdak's right, you'll have to P/Invoke SetTimeZoneInformation (see the DllImportAttribute ), which is supported by Windows CE 1.0 and later (which means Pocket PC 2002 and 2003 support it).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Many thanks for help provided
In my search for help I came accross a usefull site which contains a near complete win32 api library with source code written in C#
OpenNetCF
CyMad
CF Developer
|
|
|
|
|
Hello all,
I would like to know what the best practice is for testing if a program has a valid internet connection. I have a function which tells me if the program is connected or not but I would hate to have to call this everytime I need to perform some operation.
What I am looking for is something like in Messenger when you lose an internet connection it notifies you. Am I limited to a timer that constantly checks for the internet connection or is there some way my app can receive a message when a connection gets unplugged or something similar.
Does this make any sense? Any help is greatly appreciated.
Thanks,
Troy G
|
|
|
|
|
Yes, you have to check it in a timer or thread. Whats the problem with that?
Mazy
You're face to face,
With the man who sold the world - David Bowie
|
|
|
|
|
Mazy,
No problem. Just thought there may be something else I could do that would be easier on resources.
Thanks for responding,
Troy
|
|
|
|
|
Hi there
I have the same problem as yours
but u have at least made a function to get yr work done.
I couldnt even do that !
can u plz pass a copy of that function to me?
Thanks
VisionTec
|
|
|
|
|
visiontec wrote:
can u plz pass a copy of that function to me?
Just P/Invoke InternetGetConnectedState[^] and call it when your Tick event fires from your timer.
- Nick Parker My Blog
|
|
|
|
|
This is what I use, there are a bunch of them...
//Creating the extern function...
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState(out int Description, int ReservedValue);
//Creating a function that uses the API function...
public static bool IsConnectedToInternet()
{
int Desc ;
return InternetGetConnectedState(out Desc, 0);
}
|
|
|
|
|
im using ADO.Net to connect to my database(im using Visual Studio .NET 2003) whenever i add the namespace System.Data now when i add this
i dont have System.Data.OleDb in the list when intelisense pops up...is something wrong?...so im using System.Data.SqlClient...can this work with SQL SERVER 7.0 databases...i read in a book(C# How To Program by Deitel & Deitel) that System.Data.SqlClient only for SQL SERVER 2000 databases
oh yeah can i know any WEB SITE where i can get a really good explaination abt Manipulating a Database.(ADDING,INSERTING,DELETING,MODIFYING...ETC)
Arvinder Gill
|
|
|
|
|
ASGill wrote:
so im using System.Data.SqlClient...can this work with SQL SERVER 7.0 databases
Yes, it works with SQLServer 7 and later.
ASGill wrote:
i read in a book(C# How To Program by Deitel & Deitel) that System.Data.SqlClient only for SQL SERVER 2000 databases
Nope.
ASGill wrote:
i dont have System.Data.OleDb in the list when intelisense pops up...is something wrong
Go to project references and add System.Data namespace.
Mazy
You're face to face,
With the man who sold the world - David Bowie
|
|
|
|
|
hi!
what should i do when i make use of the ReadFile function from the Packet Analyzer program(by floack), and i get an error saying that "a device attached to the system is not functioning". I am trying to integrate a ping feature to that program when i would send a ping request and wait for its reply. i am able to sucessfully send the request, however when i use the ReadFile to listen to the same port, i get the error stated above. can anyone help me with this problem?
Thanks!
Lots
|
|
|
|
|
This isn't a forum for specific application issues like that. If you have a quesiton about that program or wish to report a bug, please contact the author or visit any forums that application may have attached.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hi!
what should i do when i make use of the ReadFile function from the Packet Analyzer program(by floack), and i get an error saying that "a device attached to the system is not functioning". I am trying to integrate a ping feature to that program when i would send a ping request and wait for its reply. i am able to sucessfully send the request, however when i use the ReadFile to listen to the same port, i get the error stated above. can anyone help me with this problem?
Thanks!
Lots
|
|
|
|
|
Hi, I'm working on a small app that has a tab panel and I need to create a new tab with a few buttons and text boxes each time a text file is opened. My problem is how to create an identical tab each time with all of the same buttons and boxes with all the same code. Any ideas? Thanks.
-NF
|
|
|
|
|
The best way is to extend TabPage with your own class and add all your controls and default logic to that class. Whenever you need to add a new tab to your TabControl , simply instantiate a new instance of your custom TabPage class and add that to TabControl.TabPages .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Ok thanks for the help, I did what you instructed but the new TabPage will not show up on the form. I looked around for methods that seemed to help update Windows Forms controls. I found SuspendLayout() and ResumeLayout() and also Refresh(). I invoke SuspendLayout on the From, TabControl, and the TabPage before adding the controls to the TabPage, then to the TabControl. Then I do ResumeLayout(false) for all three objects after everything is done. That didn't work so I called Refresh() on everything that I logically could. Still no new tab? I made sure I added the TabPage to the TabControl and everything. Any ideas? Thanks again for your help.
-NF
|
|
|
|
|
Never mind I just had to much code mixed up all over the place, anyway, it works now. Thanks again for your help.
-Noah Fields
|
|
|
|
|
How do I make an input box in C#? Also, how do I make the null value of the text of a label control a condition for an if statement?
|
|
|
|
|
Eric Houser wrote:
how do I make the null value of the text of a label control a condition for an if statement?
if(label1.Text=="")
{...}
Eric Houser wrote:
How do I make an input box in C#?
TextBox Control.
Mazy
You're face to face,
With the man who sold the world - David Bowie
|
|
|
|
|
Actually, null and an empty string are two different things entirely. To check for null (to the original poster), simply use obj == null , where obj is an reference variable (value types cannot be null).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Yah, null and emtpy are different but I think he meant that How can I check there is no string in label.
Mazy
You're face to face,
With the man who sold the world - David Bowie
|
|
|
|