|
Welcome to CodeProject
I strongly urge you to use beginner based materials to start learning how to program rather than asking questions on internet forums. Things like books or tutorials found on the web. We have a large collection of Articles here at CodeProject some of which are targeting beginners. You can find those articles under the Chapters section of the site menu.
I believe most people will learn beginner level subjects much faster from coordinated material rather than using internet forums.
led mike
|
|
|
|
|
Check out msdn and look at the FileInfo, DirectoryInfo, StreamReader, and StreamWriter classes. MSDN gives some good examples as to how to use these classes.
|
|
|
|
|
jay_t55 wrote: on form load
open c:\hello.txt
read c:\hello.txt
insert c:\hello.txt into Textbox.Text
As its been already said that you should first read the basic of c#(infact programming).
My suggestion is that even ebfroe posting the question try to Google its out. a simple serach would have yield this [^]result for you.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
How can I write the C# code that would allow me to view an image file using a viewer control. I want to be able to say:
On selected index changed
read System.Byte in the Details_dwg field
Load into viewer control.
|
|
|
|
|
technette wrote: How can I write the C# code
I prefer to use a keyboard.
led mike
|
|
|
|
|
New to C# and am under the gun. Please include keyboard stroke.
|
|
|
|
|
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
Control myControl = FindControl("dwgViewerCtrl");
const string sql = "SELECT Detail_dwg @Detail_dwg FROM Detail_Info WHERE [Detail_ID] = Detail_ID";
using (SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DetailsDBFConnectionString3"].ConnectionString))
{
myConnection.Open();
myControl = BoundField("@Detail_dwg", imageBytes);
}
Not finding my SQL Connection. WHY?
|
|
|
|
|
I'm trying to create a report with a crystalReportViewer, who knows if it is possible to make a scroll bar scrolling not only one page but through all pages?
Thank you.
|
|
|
|
|
Hi everyone.
I have wrote a little program which uses mysql server, but now I need to remove mysql server and you some sql database witch do not need to you another install application...
Anyone has any ANYYY kind of tip??
Thanks A LOT in advance.
|
|
|
|
|
You want to replace MySql database with MS Sql database for your application?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi!
I need to replace the mysql for any other database type... Because...
The client doesn´t want to install anything else besides my application and I don´t want to lose my implementation with "insert"s "delete"s and "update"s....
|
|
|
|
|
|
|
Hey guys.
Can we show an object (for example an imageBox) by toolTip ?
Thanks in advance .
|
|
|
|
|
|
Hello All.
I would like to know what api calls/functions are required to retrieve all the application version numbers that are currently installed on a windows platform.
What I want is to get all the version numbers as displayed when one goes to the Control Panel->Add/Remove Programs.
I want to get the application names and the versions so I can generate reports, forward in an email etc.
Does any body know how to do this?
Many thanks,
Matt
|
|
|
|
|
You need to enumerate the registry entries in this location
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Try these:
Assembly Version:
Assembly.GetExecutingAssembly().GetName().Version
File Version:
System.Diagnostics.FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location)
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
He doesn't want o know his application's version but the version of all apllication on Windows...
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thanks,
but how do I use 'Assembly.GetExecutingAssembly().GetName().Version' to get the applications the at are 'installed' on the system?
|
|
|
|
|
You'll have to use Interop services to check the version number of executables, and
Use WMI to get a list of installed applications (look at the Win32_Product class). There is a "Version" property available that gives you what you want.
BTW, there was no need for anyone to vote a 1 on my first response. That was pretty rude, considering nobody else has suggested a solution.
Here's some code from one of my own projects. The GetObjectPropertyString() method is one of several helper methods I wrote that serve no other purpose than to clean up the code that I'm actually working in. No messy exception handling, no conversions - just a function call.
private static string GetObjectPropertyString(ManagementObject mo, string name, string defaultValue)
{
string value = defaultValue;
try
{
value = mo[name].ToString();
}
catch (Exception ex)
{
if (ex != null) {}
#if DEBUG
System.Diagnostics.Trace.WriteLine(string.Format("GetObjectPropertyString() EXCEPTION - looking for {0} property", name));
#endif
}
return value;
}
ManagementClass mc = new ManagementClass("Win32_Product");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
string name = GetObjectPropertyString(mo, "Name", "");
string version = GetObjectPropertyString(mo, "Version", "");
}
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
modified on Friday, September 5, 2008 11:28 AM
|
|
|
|
|
Thanks very much for your email.
It all work perfectly now. Many thanks.
Matt
|
|
|
|
|
Did my last response help?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello John.
thanks for your response concerning ManagementClass and ManagementObjectCollection. I have implemented this which returns everything that I need but it is hideously slow. I have had to run it in a seperate thread since it sometime takes minutes to finish.
Is this normal? Is there another way you know which is faster? When one click add remove programs it does not take this long.....
Thanks,
Matt
|
|
|
|
|
How long it takes depends on how much stuff you have installed, and what kind of system you have. I'm running XP-64 with 8gb of RAM and fairly speedy hard drives. With about 60 things installed, it takes about 4 seconds for Add/Remove Programs to populate itself.
BTW, did you vote my response a 1?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|