|
Jacob Dixon wrote: My professor is not helping out very much
Some times that's the best kind of help.
Animal, Dog, and Cat will need constructors (as I think you know by now).
I wouldn't bother storing the WhatAmI, but instead access the name of the type, otherwise you can get:
Dog mydog = new Dog("Tiger", "Spot"); , maybe just do a sanity check on the passed value, but it's a poor design.
As it's homework I suggest the use of an automatic property for WhatIsMyName.
|
|
|
|
|
yea he didn't like how I did it. He is saying the strings in Animal should be private not protected. He is saying I should not have access to those directly but through properties.
|
|
|
|
|
Hi all,
I have a application that receives a data buffer from TCP\IP, and save the buffer with the corresponding timestamp the event ocurred.
Now I need to simulate the TCP\IP data arriving just by reading the log, but using the timestamp information, to receive the events along with the same timings I would if using the original channel.
This code isn't hard but it would be good to get something ready for use. I'm sure this kind of requirement is not new.
Any tips ?
Thanks !
|
|
|
|
|
hi
in my app, i fill dataTable with some records include this columns :
DataColumn dcSpName = new DataColumn("SpName");
DataColumn dcParameterName = new DataColumn("ParameterName");
DataColumn dcSystemType = new DataColumn("SystemType");
DataColumn dcLength = new DataColumn("Length");
DataColumn dcIsOutputParameter = new DataColumn("IsOutputParameter");
as u can see, i want to load all stored procedures in my database with all parametersInfo, therefore, each new parameter for single sp cause new record insert into my dataTable object.
now, i want to remove duplicates rows from my dataTable objects to remain unique storedProcedures in my dataTable object, but how to remove them ?
thanks
|
|
|
|
|
You have this table just in memory ? Your easiest way is to not insert duplicates in the first place.
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 )
|
|
|
|
|
no,
i want to get all information about stored procedures, then copy it to another dataTable abject and remove duplicates rows from it, but how to do ?
|
|
|
|
|
The info is coming from a stored proc ? Then your best bet by far is to ask the DB to remove doubles. If you're adding from more than one stored proc, I assume they are from different DBs for you not to use SQL, and again, your best bet is to check before you add.
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 Christian
my problem has been solved.
i was create new datatable named 'dtHelper' object and copy structure of my main datatable object, then add PrimaryKey to dtHelper and before add new row to it, check the current row with contains method.
thanks.
|
|
|
|
|
hello friends
I would like to know how to connect a C# application to a biometric device
Something like thumb impression device to C# application
Thank You
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
Start by connecting the device to a computer, now where and how it is connect to the computer is relative information to how you are going to interface with it from your C# or whatever application.
Good luck
led mike
|
|
|
|
|
You're going to have to elaborate if you were hoping for any kind of useful answer.
Scott P
“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.”
-Edsger Dijkstra
|
|
|
|
|
You are going to have to target the reader with an SDK from the manufacturer.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
i am having a thumb impression reader ...
Which connects to my Pc ... to USB
Now in my software i need to show the info of a person whose thumb impression matches with the Stored impression of the biometric device
Got an idea using SDK ..
If anyone has used it before then please do reply
Thank You
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
i'm working on a very simple time attendance web application
i'm saving the StartTime into SQL Server 05 Column.
what i need is to save the diffrence between the StartTime and the EndTime when the user is entering his leaving time.
my table is like that
Col1 :: col2 :: col3 :: col4
EmployeeID::StartTime::EndTime::TimeDiff
is there is any way i can do this
Ahmad AbuBakr
www.egyptvision.com
|
|
|
|
|
You can calculate different between DateTime instance from your application and store it in the database or you might make your TimeDiff column computed so that it stores difference between EndTime and StartTime (for example in seconds). You can use DATEDIFF[^] function for calculating difference between two dates in sql server.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
As Giorgi said, it may be best to get SQL to do this for you.
If you want to do it in C# (I assume so as you're asking in the C# forum), look at the Timespan struct.
DateTime now = DateTime.Now;
DateTime then = DateTime.Now.AddHours(-1);
TimeSpan duration = now - then;
MessageBox.Show(duration.ToString());
Dave
|
|
|
|
|
Hey all -
I'm a total newb, and I'm trying to use the WSUS API to connect to a specified WSUS Server and "do stuff". The problem is that it currently uses the currently logged on use to connect to the WSUS server, which fails. If I do a "run as" on the program, and use the correct credentials, it works.
So, the question is how to prompt for credentials (command line) and connect to the WSUS server?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using Microsoft.UpdateServices;
using Microsoft.UpdateServices.Administration;
namespace WSUS_Check
{
class Program
{
static void Main(string[] args)
{
string Server;
int Port, ans, count;
bool Secure;
ArrayList TGIDs;
System.Console.WriteLine("*******************************************************************************");
System.Console.WriteLine("Custom WSUS Check, v0.01");
System.Console.WriteLine("*******************************************************************************");
System.Console.WriteLine();
System.Console.Write("WSUS Server: ");
Server = System.Console.ReadLine();
System.Console.Write("Port: ");
Port = int.Parse(System.Console.ReadLine());
do
{
System.Console.Write("Secure [1\\0]: ");
ans = int.Parse(System.Console.ReadLine());
} while ( (ans != 1) && (ans != 0) );
if (ans == 1)
{
Secure = true;
}
else
{
Secure = false;
}
IUpdateServer Host;
try
{
Host = AdminProxy.GetUpdateServer(Server, Secure, Port);
System.Console.WriteLine("Connected to " + Host.Name.ToString() + " [WSUS v. " + Host.Version.ToString() + "]");
System.Console.WriteLine();
System.Console.WriteLine("Client groups on " + Host.Name.ToString() + ":");
ComputerTargetGroupCollection CTC = Host.GetComputerTargetGroups();
count = 0;
foreach (IComputerTargetGroup TG in CTC)
{
System.Console.WriteLine("[" + count + "] " + TG.Name.ToString() + ", " + TG.Id.ToString());
count++;
}
}
catch (Exception e)
{
System.Console.WriteLine();
System.Console.WriteLine(e.Message);
}
System.Console.WriteLine();
System.Console.WriteLine();
System.Console.WriteLine("Press any key to continue... ");
System.Console.ReadKey();
}
}
}
|
|
|
|
|
Since this is a console app, you could just create a batch file to run your program as who ever with the runas command.
That way you don't need to have have to modify your code.
Just because we can; does not mean we should.
|
|
|
|
|
Sure, that's one way, but not the way I'd like to see it done.
The code has to be modified anyways, midas well do it now. Plus I can learn the an auth. peice from this, which will be cool.
|
|
|
|
|
Did you find a solution for this? I am facing the same problem. If you found a solution can you share the sample code.
|
|
|
|
|
save key board strokes in a file byt using a windows service
|
|
|
|
|
...? Thats not even a question, and it sounds like some kind of malware keylogging thing.
Perhaps if you could elaborate a little more.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
yes , when we use internet all urls , chatting , e-mail's should be recorded into a file and that file should be invisible to see until we go to the "FOLDER OPTIONS" and enable to show files
|
|
|
|
|
1 - ask real questions, as in full sentences
2 - if you want to do something that could be used for extreme nastiness, you better explain your benign use for it and pray we believe you.
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 )
|
|
|
|
|
I'll give you the benifit of the doubt and assume your not up to anything nasty!
As a service it's pretty much impossible for reasons described here[^].
If your application has a legitimate purpose, then your end user won't object to a program running from the tray at least, in which case this[^] and this[^] may be of use.
Dave
|
|
|
|