|
Kindly suggest the name of book which is cover all the topics and points for making an complete application in C#.net. is their any E.books covering all the topics.
thanks
|
|
|
|
|
amaankhan wrote: all the topics and points
This is broad of a field and subject to be covered in one tome.
only two letters away from being an asset
|
|
|
|
|
how can I check if a user on Facebook is online or offline in order to show a notification to the user?
|
|
|
|
|
|
how can I check if a user on Yahoo Messenger is online or offline in order to show a notification to the user?
|
|
|
|
|
www.imvisible.info...this is website from which u can see and many software are also there.
|
|
|
|
|
how can I find source code in C# 2.0 or ASP.NET?
|
|
|
|
|
|
Thank a lot! I saw two samples, but they used Yahoo API. However, it doesn't check "invisible" YahooID.
|
|
|
|
|
BabyMouse wrote: but they used Yahoo API. However, it doesn't check "invisible" YahooID.
Hi,
Those links dosen't use any yahoo API. to use yahoo API with your application, you
can get more info here http://developer.yahoo.com/[^]
Thanks, Satalaj
|
|
|
|
|
I may be mistaken between Yahoo API and OPI, but host opi.yahoo.com not check "invisible" YahooID.
|
|
|
|
|
how can I check if a user on MSN Messenger is online or offline in order to show a notification to the user?
|
|
|
|
|
|
How can I make a ping to a website or IP address in thread and all in run-time?
|
|
|
|
|
Ping.SendAsync[^] does an asynchronous ping, sounds like that's what you're looking for
|
|
|
|
|
In a comboBox as you move the mouse across the list of items, the item under the mouse is highlighted (without clicking on it). How do you make a list box work the same way? Currently I display a different picture for each item in the listbox as the mouse moves over it, but without it higlighting as I move over it, it is sometimes difficult to tell which item I am drawing for. I have search the internet and several books for this but have not found anything related to this topic.
Gary
|
|
|
|
|
The simplest way to achieve this is to get the index of the item that is below the mouse using the IndexFromPoint and select this item:
private void listTest_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
int index = listTest.IndexFromPoint(e.X, e.Y);
listTest.SelectedIndex = index;
}
Regards
Nuri
|
|
|
|
|
I knew there had to be a simple way to do it, and after seeing this I feel embrassed that I didn't think to try that myself. Thank you very much.
Gary
|
|
|
|
|
Hi. I'm now using the SortedList<TKey, TValue> to sort the strings from the text file. Is it possible to have a single key as the basis for comparing each string? If yes, I want to know how i will prevent the key from duplicating. Can someone help me?
As of now this is what I accomplished:
public static void SortByLastName(ref string[] arrayOfLastNames, ref string[] arrayOfFirstNames, ref string[] arrayOfPlateNum, ref string[] arrayOfType, ref string[] arrayOfYear)
{
Console.Clear();
int vehicleCountInt = 0;
Console.WriteLine("SHOW DATABASE: SORTING BY LAST NAME\n");
using (StreamReader countVehicle = new StreamReader("vehiclecount.txt"))
{
vehicleCountInt = Int32.Parse(countVehicle.ReadLine());
countVehicle.Close();
}
SortedList<string, string> sortedLastName = new SortedList<string, string>(vehicleCountInt);
using (StreamReader outputLastNames = new StreamReader("lastnames.txt"))
{
for (int i = 0; i < vehicleCountInt; i++)
{
arrayOfLastNames[i] = outputLastNames.ReadLine();
string keyVal = arrayOfLastNames[i];
sortedLastName.Add(keyVal, arrayOfLastNames[i]);
if (!sortedLastName.ContainsKey(keyVal))
{
sortedLastName.Add(keyVal, arrayOfLastNames[i]);
}
else
{
sortedLastName.Remove(keyVal);
sortedLastName.Add(keyVal, arrayOfLastNames[i]);
}
Console.WriteLine("{0}", sortedLastName.Keys[i]);
}
outputLastNames.Close();
}
}
modified on Friday, September 4, 2009 11:47 AM
|
|
|
|
|
gamer1127 wrote: sortedLastName.Add(keyVal, arrayOfLastNames[i]); //I'm having a run-time error here that throws the ArgumentException
What information does the debugger show? The ArgumenException implies that one of the arguments to the sortedLastName.Add() call contains an invalid value, quite possibly null.
|
|
|
|
|
It says that an entry with the same key already exists.
|
|
|
|
|
gamer1127 wrote: sortedLastName.Add(keyVal, arrayOfLastNames[i]); //I'm having a run-time error here that throws the ArgumentException
if (!sortedLastName.ContainsKey(keyVal))
{
sortedLastName.Add(keyVal, arrayOfLastNames[i]);
}
else
{
sortedLastName.Remove(keyVal);
sortedLastName.Add(keyVal, arrayOfLastNames[i]);
}
You did it wrong, then you did it right. Why do you even have the line that is getting the error? You are doing the same thing with the next if block.
gamer1127 wrote: Console.WriteLine("{0}", sortedLastName.Keys[i]);//And sometimes throws the exception ArgumentOutOfRange Exception
You are getting this error for the same reason you were getting the previous error. If you have a duplicate key, you will not have "i" items in the list. You need to check if that many keys exist before trying to write them out.
On an style note, it appears that you have several properties of items all stored in separate arrays, and a single array of a class (with FirstName, LastName, PlateNumber, Type, and Year properties) may be better. Also, there is no reason to pass the array by ref just to change the values in them. If you are passing the array by ref so you can change the length, I would suggest returning an array instead, since you do not seem to be using the data already in the arrays.
|
|
|
|
|
Gideon Engelberth wrote: On an style note, it appears that you have several properties of items all stored in separate arrays, and a single array of a class (with FirstName, LastName, PlateNumber, Type, and Year properties) may be better.
Can you please show an example for that?
By the way, I already solved the problems. I'll get back to you guys when a new problem comes up.
|
|
|
|
|
What if there are values that are the same? How will I show those two? I know that they must have different keys but how will I exactly do that?
For example:
Hibaler
Balde
Metin
Dela Vega
Dimagiba
Pederoso
Dinulos
Du
Gotengco
Lira
Guban
Garraez
Carpena
Reyes
Zulueta
Gonzalez
Isidoro
Marfa
Reyes
Guinhawa
Aaron
Lazaro
Obsum
Molino
Estenor
Nolasco
Paral
Porillo
Novillos
Alihan
How will I assign different values for the other so i can show them both after sorting?
|
|
|
|
|
why are you making everything much more complex than necessary?
dictionaries (SortedList is a dictionary) require keys to be unique, which does not match your application; so forget about dictionaries as your primary storage.
you can keep a list of strings (any strings including duplicates) in a List<string> which you can simply sort by calling myList.Sort()
you can also define your own little class "MyType" (holding name, age, address, vehicleColor, whatever) and collect those in a List<MyType>
Strings get sorted alphabetically by default; your own objects don't have a default sort order. If you need a (special) sort order (i.e. non-alphabetic for strings) you can easily do that with an object that implements IComparable; I wrote a little article[^] that explains it all.
FWIW: I strongly recommend you buy and study a book on C# to increase your basic knowledge of the language and the .NET framework. Here[^] is why.
|
|
|
|