|
C# Network Programming[^] by Rich Blum is a really good source of information on Socket Programming in C#
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"Get in touch with your Inner Capitalist - I wish you much success!" -- Christopher Duncan, Lounge 9-Feb-2004
|
|
|
|
|
Hi all,
I've played around with the Shellnotifications...
(http://www.codeproject.com/csharp/shellnotifications.asp?target=Shellnotifications)
I want to read out the InternetExplorer History Notifications.
I've changed the Register Event to CSIDL_HISTORY but it didn't work correctly.
If I click on an IE link, nothing happens.
I have seen it working in a vb project.
(http://vbnet.mvps.org/index.html?code/shell/shchangenotify.htm)
Somebody got a solution?
|
|
|
|
|
I have an ArrayList of objects (all the same type). All of these objects (classes) contain a string property Name. I also have a variable CurrentMyObject that shows witch MyObject to use currently (there are a lot of MyObject instances, try to think of MyObject as of an adapter).
<br />
<br />
private MyObject CurrentMyObject;<br />
private ArrayList MyObjectsList = new ArrayList();<br />
public class MyObject<br />
{<br />
protected string name;<br />
public string Name {...}<br />
}<br />
<br />
...<br />
string something = CurrentMyObject.Name;<br />
...<br />
Is it possible to let the user set the CurrentMyObject from a dropdown meny in Property Editor inside IDE (design time)? I mean to create a list (maybe an array) of each MyObject instance's name string and the set the CurrentMyObject by the name property. There's no problem with setting the CurrentMyObject by a name, the problem is how to create the combobox inside Propert Editor to let the user to do that inside IDE (VS.NET property editor) ...
Regards, Desmond
|
|
|
|
|
You need to attach a TypeConverter via the TypeConverterAttribute that returns true for TypeConverter.GetStandardValueSupported (there are other ways as well). Read about the classes in the System.ComponentModel namespace, and read the section in the .NET Framework SDK, Enhancing Design-time Support[^]. Besides talking about TypeConverter s, there are a great many other design-time features you can exploit that are discussed.
BTW, many Types (like Enums) already have TypeConverter s associated with the Type, such that any property of that Type uses the TypeConverter unless the property is attributed using a TypeConverterAttribute that specifies a different TypeConverter to use.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks, unfortunately I cannot use enums (unless there is a way to construct a dynamic enum at runtime). It's a lot of reading I have to do (at msdn).
Anyway, could you please provide me with an example with this case here ?
|
|
|
|
|
I didn't tell you to use enums. Just that enums have a default TypeConverter associated with them. TypeConverter.GetStandardValuesSupported and TypeConverter.GetStandardValues aren't just for display enum members either. Lots of properties use this, whether it's displaying the names of controls (of a particular Type, perhaps) by getting the container and enumerating the controls, or anything like that.
If you read the documentation I gave you links for, there are plenty of examples in the topics. Besides, there's few methods to implement and they should be obvious how to use.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks, I will. I sometimes have trouble understanding english, it's really not my native language, so this should explane the misunderstandings.
|
|
|
|
|
Sorry. You could've fooled me, though! Your grammar is excellent - much better than most American's I've seen.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
That's because I try to write grammatically correctly as possible (I try to make use of what I've learned). I'm actually from Estonia (Europe, next to Finland over the Baltic sea).
|
|
|
|
|
I am currently involved in a barcode scanning project using .NET compact framework & C#. I need to programatically be able to set the timezone of the device when the application starts. The MSDN documentation only seems to have a gettimezone method in the timezone class & no way of setting it . Is there away to set this?
Any help would be much appreciated
CyMad
CF Developer
|
|
|
|
|
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
|
|
|
|