|
Thanks Steve!
But another question is What the "System Class" means?
Foxcoming
Another Brick in the WALL
|
|
|
|
|
I'm sorry, I just ment all the classes in the System namespace.
|
|
|
|
|
i have to integrate google earth and GPS device using C#.how can i do that.waiting for ur reply.
|
|
|
|
|
Hi,
You may have misunderstood the purpose of this forum. We take people's programming problems and we help the to resolve coding issues.
Seeing as you have posted neither code, nor an actual problem you are facing, there is little technical answer that can be given.
|
|
|
|
|
Go to Google[^] and look for the links to the SDK's for their products. Also post this on their own forums since you'll not get an answer in this one.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
I have been wondering how to implement "class inheritance" so you can write code that looks something like program below. I want to make a class object like "player" with array index, then call to "Card" property which I want to have array indexed as well, and also inherits GetSuit() and GetValue() functions.
The two classes below are just something to start with. Because Im new to this kind of structure, can anyone point out what technology is used, give some examples or information on how to get them. Thanks
namespace ConsoleDebugger
{
class Program
{
static public Player[] player = new Player[2];
static public Deck deck = new Deck();
static void Main(string[] args)
{
player[0].Cards[0].GetSuit();
player[0].GrabCard( deck.DealNext() );
}
}
}
These two here below dont make much sens, just something to start with...
public class Player
{
public void GrabCard(int SomeCard)
{
}
public int Hand
{
}
}
public class Card
{
private int[] yourCards = new int[2];
public int this[int index]
{
get { return yourCards[index]; }
set { yourCards[index] = value; }
}
public int GetValue()
{
}
public int GetSuit()
{
}
}
|
|
|
|
|
Starting at your top level
static public Player[] player = new Player[2];
This line is fine, it declares an array of Player objects, but importantly does NOT instantiate any Player instances.
player[0].Cards[0].GetSuit();
This line is fine, in principle, however note the above comment about no Players having been instantiated. This line would cause a null reference exception even if Player had been defined correctly.
so lets add this instead (purposly missing out unimportant stuff):
static public Player[] players = new Player[2];
static void Main(string[] args)
{
players[0] = new PLayer("Jim");
players[1] = new Player("Bob");
int suit = players[0].Cards[0].GetSuit();
}
This now looks better as players[0] & players[1] are instantiated with new Player instances. Breaking the final line down:
int suit = - your GetSuit() method returned an integer, so I am capturing that return. You may wish to consider using an Enum for Suit, but this is a personal preference
players[0] - this will work as-is because players is an array which already has a numeric indexer
Cards[0] - your Player object will need a property named Cards, which must return an object which has a numeric indexer (much like an array). often collections are used for this purpose. The return value of this indexer must be an object that exposes a method named GetSuit().
here is a quick demo of how this is possible:
public class Player
{
private string name;
private CardCollection cards;
public Player(string name)
{
this.name = name;
this.cards = new CardCollection();
}
public CardCollection Cards
{
get{ return this.cards; }
}
}
public class CardCollection : CollectionBase
{
... implementation of BaseCollection
public Card this[int index]
{
get{ return InnerList[index] }
}
}
public class Card
{
private int suit;
... implementation of card
public int GetSuit()
{
return this.suit;
}
}
|
|
|
|
|
Thanks for a quick and good response. I could'nt get "GetSuit()" to connect to the CardCollection object but this is a good start.
Thanks mate
---
Steini
|
|
|
|
|
GetSuit should be on Card, not CardCollection
|
|
|
|
|
Is there a class available to convert data from Little to BigEndian?
Regards
Hansjörg
|
|
|
|
|
If you found usefull.
See this.
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
I need something to convert a byte array (which contains int, int64...) from big to little endian.
I don't see any possibitlity to use this class, isn't it?
Thanks for your help!
Regards
Hansjörg
|
|
|
|
|
Best way is to write some methods yourself, what types do you have to convert?
public static int ReverseEndian(int x) <br />
{<br />
return ((x<<24) | ((x & 0xff00)<<8) | ((x & 0xff0000)>>8) | (x>>24));<br />
}<br />
<br />
public static uint ReverseEndian(uint x) <br />
{<br />
return ((x<<24) | ((x & 0xff00)<<8) | ((x & 0xff0000)>>8) | (x>>24));<br />
}<br />
<br />
...
|
|
|
|
|
I have to convert all standard types...
I hoped that something is available
Thanks for your help!
|
|
|
|
|
I don't know of any implementation that does it, the code I gave was from a program of mine where I also did everything myself.
If you have to convert all standard types I would create your own BinaryReader which takes the default BinaryReader as parameter and endian swap each method before passing back.
using System.IO;<br />
<br />
public class EndianReader : BinaryReader<br />
{<br />
#region Constructors<br />
<br />
public EndianReader(Stream stream)<br />
: base(stream)<br />
{<br />
}<br />
<br />
#endregion<br />
<br />
#region Methods<br />
<br />
public override int ReadInt32()<br />
{<br />
return ReverseEndian(base.ReadInt32());<br />
}<br />
<br />
#endregion<br />
<br />
#region Class Methods<br />
<br />
public static int ReverseEndian(int x)<br />
{<br />
return ((x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24));<br />
}<br />
<br />
#endregion<br />
}<br />
|
|
|
|
|
how to print the datagrid after user input certain parameter to display the datagrid in Web page??
angela
|
|
|
|
|
Hi Angela,
If u want to print data which have dynamic attributes to be displayed then u can use Cellset.
Cellset might be the solution to ur query.
Not sure....
|
|
|
|
|
hi,
sorry that i dun know about Cellset, how to call it to print my datagrid?
also thanks for your suggestion
angela
|
|
|
|
|
Hello!
I want to write a proxy server with access log and content filtering or cashing.
I wrote a proxy server with access log!!
Somebody knows how can I add content filtering to it !
please help me
thanks
Mitra
|
|
|
|
|
hi
i want use VScrollbar in my form but don't know how do that and my scroolbar is not work .
how to do that ?
|
|
|
|
|
is it for a certain control? See in the properties of that control, otherwise you can do it via inserting a panel, which does has those properties, if you want it on your entire form for example, you need to add it first and your controls after that into that panel, then you calculate the size your panel needs to be and resize it. If the panel then goes outside your form, you should get scrollbars (if all is correct)
Good luck,
No hurries, no worries.
|
|
|
|
|
I have two application. One appli use one COM object releted to RTP streaming.
Now if i transmit packet by this appli & other end this appli receive that packet & play the sound it work well.
But the appli transmit packet my second appli capture that packet & retranmit to first appli then it will not play well.
I can't understand what is the problem.
In COM object i just specified IP & Port no. In Other appli i create on socket of UDP type. When i check for header of RTP it is correct but what about payload i don't know.
Plz help me.
Regards,
Divyang Mithaiwala
|
|
|
|
|
Dear All,
Im doing a setup application. Where i need to install the .Net Framework and then the application setup by a single button click from my application.
In button click i need to run the set up Msi file in a quite mode using the /q arguement in the command prompt. How to achieve this. Please help me out.
Struggling with this. Anyhelp will be greatfull to me.
Regards
Mukilan.P.S
|
|
|
|
|
i wish to discover all the systems in a network using wmi and c# as the scripting language...can u please help me out...
barath pc(barathchidambaram@gmail.com)
|
|
|
|
|