|
Good Day to all,
I've read article (http://www.codeproject.com/KB/cs/hard_disk_serialno.aspx ) here in CodeProject that is about retrieving the manufacturer's serial for a certain physical hard drive.
What I need is the one that can get the manufacturer's serial for a FLASH DRIVE, the usb type thing.
Is there any articles on how to do this?
PS: I'm after the real SERIAL, not the WMI type.
Thanks,
Ian
|
|
|
|
|
|
Yes there is. Sorry, that was a misfire. Submitted the original question.
|
|
|
|
|
Have you left a message for the author of the said article? There is a forum at the bottom of the article page.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
No, but someone already posted this same question. And the author seems to be already inactive.
|
|
|
|
|
MyReport rpt = new MyReport();
rpt.SetDataSource(MyDataset.Tables[MyTableName]);
rpt.SetParameterValue("MyParameter");
MyReportForm rptForm = new MyReportForm(rpt);
I was wondering if there's a smarter way to do maybe by converting my report once to object but then I cant access all the report's methods and members like the setting the datasource and the parameters.. I was thinking:
object rpt = new MyReport();
rpt.SetDataSource(MyDataset.Tables[MyTableName]);
rpt.SetParameterValue("MyParameter");
<font color="#00aadd">rpt = new AnotherReport();</font>
rpt.SetDataSource(MyDataset.Tables[MyTableName]);
rpt.SetParameterValue("MyParameter");
Thank you guys
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
EDIT: I reread and understood what was being asked.
You could use an interface or abstract class and do something like:
<br />
IReport rpt = new MyReport();<br />
rpt.SetDataSource(MyDataset.Tables[MyTableName]);<br />
rpt.SetParameterValue("MyParameter");<br />
<br />
rpt = new AnotherReport();<br />
rpt.SetDataSource(MyDataset.Tables[MyTableName]);<br />
rpt.SetParameterValue("MyParameter");<br />
where IReport is:
<br />
public interface IReport<br />
{<br />
void SetDataSource(DataTable source);<br />
void SetParameterValue(string parameter);<br />
}<br />
or if you want to use properties:
<br />
public interface IReport<br />
{<br />
DataTable DataSource { get; set; }<br />
string Parametervalue { get; set; }<br />
}<br />
Then have Report and AnotherReport implement the interface.
|
|
|
|
|
|
How would I, for every 10 numbers in an int, do an event? What I need help with is the foreach part? I'm confused as of what exactly to put: foreach (myInt in ???)
{
}
Thanks.
- I love D-flat!
|
|
|
|
|
Every 10 digits in what int ? You mean as in the int 12345678901 fires one event ? When ? When it's being entered ? If you have a string you can use the length property to check how long it is.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
int But I don't undertand how to calculate this in the language. foreach (myInt in (what goes here?)
- I love D-flat!
|
|
|
|
|
Convert the number to a string, then loop through the characters in that string.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
int.MaxValue is 2147483647. (Which is 10 digits).
Without using a 'bigger' space to store an integer (Int64) this will only 'fire' once if at all.
If this is true and you are using an int then if (myInt > 999999999)... will be sufficient.
If the integer is in string form then myStr.Length / 10 will give you the number of 'ten digits' there are in the string.
Matthew Butler
|
|
|
|
|
MasterSharp,
I think you've misunderstood the foreach slightly.
Foreach (int currentInt in myInt)
currentInt is the current int the foreach is at in the iteration.
myInt is the collection you want to iterate through.
So, if you wanted to fire an event every 10 digits, you could do:
int myInt = 100;<br />
int tenDigit = 0;<br />
foreach (int currentInt in myInt)<br />
{<br />
if (tenDigit == 10)<br />
{<br />
tenDigit = 0;<br />
<br />
If (Event != null)<br />
Event(this, new EventArgs());<br />
}<br />
<br />
tenDigit++;<br />
}
Hope this helps.
Regards,
Gareth.
|
|
|
|
|
Yes, thank you all.
- I love D-flat!
|
|
|
|
|
gareth111 wrote: int myInt = 100;
int tenDigit = 0;
foreach (int currentInt in myInt)
myInt is an integer. Foreach requires a collection, or some object that has an enumerator defined.
Small angry dogs
My 1000th post!!
|
|
|
|
|
Malcolm Smart,
Ye. My mistake, was thinking of just a normal for();
Regards,
Gareth.
|
|
|
|
|
In regards to Gareth's post, you can't use foreach on non-array objects.
|
|
|
|
|
Jordanwb,
See above.
Regards,
Gareth.
|
|
|
|
|
|
Hey all,
I would like, if possible, you could tell me some ideas for projects.
I have a friend who needs my help doing his final project but i run out of ideas. I think helping him will help me keep the C# programming skills i got from you guys.
Thanks so much, any help is greatly appreciate it!!
Best regards
Luis E Tineo S
|
|
|
|
|
kingletas,
Final project?, as in University?
Regards,
Gareth.
|
|
|
|
|
kingletas wrote: I have a friend who needs my help doing his final project
Your friend is best asking his instructor for guidance. That is what they are supposed to be there for.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Paul Conrad wrote:
Your friend is best asking his instructor for guidance. That is what they are supposed to be there for.
I agree on that. I asked my friend to find out what kind of project or field his professor wanted but all my friend got from him was a "Think what you would like to do and we talk on Tuesday."
This is very important because this is like one big step to graduate from University.
Another thing is that my friend doesn't really know a thing about programming or hardware, so basically i will be tutoring/helping him build the project from the beginning to the end. I know there are a lot of "ethic/moral" principles involve and it might be wrong to do it. But as long as i don't cross the line between helping him to do it and do it myself i think it will be ok.
I thought of a: "Vehicle with a camera and fingerprint reader to ID the driver and the passengers" good for companies with no passengers policies. This is project is more suited for my country Dominican Republic where people tends to give a ride to anyone.
Also i thought of Mobile/smartphone application that constantly send a message where the owner is located, but the fact of violating the principle of privacy makes me uncomfortable; so i am about to discard that idea.
I have this tools, maybe it will help to know i have them:
* Microsoft Visual Studio 2005
* Microsoft Sql Server 2005
* Microsoft Finger Print Reader & the GrFinger SDK
* An extra low resolution small camera
* If it is needed i can get a GPS receiver.
* 2 PDA with WM 5
* Belkin Bluetooth adapter
* a few Atmega 8 with the "programmer"
Again Thanks for the help,
Best regards.
Luis E Tineo S
|
|
|
|
|
kingletas,
If your friend is not a programmer, do you think he will be able to do your idea of a camera and finger print reader?, with that idea, you will be writing it your self. I think you should go for something FAR simpler: a CRM app (SalesForce.com) or a content management website like Blackboard.com.
Think SIMPLE.
Regards,
Gareth.
|
|
|
|