|
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
|
|
|
|
|
I am running a dual core 2.3g pentium 2 with 2 gb of ram. See below for a list for the output of the program - note the elapsed time; It is strange because when I go to contorl panel - add/remove programs it is allot faster - even for the first time after boot. Perhaps windows in caching the entries where as this method probably reads through the registry in a manual fashion....See the output of the program below.
<<<
Querying registry for installed components. Please wait...
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
.............................................
Elapsed Time: 00:04:22.0502292
Date and Time: 9/11/2008 11:14:55 AM
Machine Name : 4GBD01914
Environment : Microsoft Windows NT 5.1.2600 Service Pack 2
Nokia Flashing Cable Driver Version: 8.23.0.0
Nokia Connectivity Cable Driver Version: 7.1.1.0
TSS Communication API int Version: 2008.26.000.34173
Nokia Service Tool Drivers Internal Version: 5.00.0000
Nokia Service Tool Drivers Internal Version: 6.04.0000
Microsoft Software Update for Web Folders (English) 12 Version: 12.0.4518.1014
Microsoft Office Visual Web Developer 2007 Version: 12.0.4518.1066
Microsoft Office Visual Web Developer MUI (English) 2007 Version: 12.0.4518.1066
Microsoft Office Visio MUI (English) 2007 Version: 12.0.4518.1014
Microsoft Office Shared Setup Metadata MUI (English) 2007 Version: 12.0.4518.1014
Microsoft Office Proofing (English) 2007 Version: 12.0.4518.1014
Microsoft Office Shared MUI (English) 2007 Version: 12.0.4518.1014
Microsoft Office Proof (English) 2007 Version: 12.0.4518.1014
Microsoft Office Proof (Spanish) 2007 Version: 12.0.4518.1014
Microsoft Office Proof (French) 2007 Version: 12.0.4518.1014
Microsoft Office Visio Professional 2007 Version: 12.0.4518.1014
Time Zone Data Update Tool for Microsoft Office Outlook Version: 12.0.4518.1029
Visual Studio Tools for the Office system 3.0 Runtime Version: 9.0.21022
WebFldrs XP Version: 9.50.7523
Microsoft .NET Framework 3.0 Service Pack 2 Version: 3.2.30729
Microsoft Windows SDK for Visual Studio 2008 Win32 Tools Version: 6.1.5288.17011
Microsoft SQL Server Native Client Version: 9.00.3042.00
Microsoft Device Emulator version 3.0 - ENU Version: 9.0.21022
MSXML 4.0 SP2 (KB925672) Version: 4.20.9839.0
Microsoft .NET Framework 3.5 SP1 Version: 3.5.30729
Windows Mobile 5.0 SDK R2 for Pocket PC Version: 5.00.1700.5.14343.06
Microsoft SQL Server Compact 3.5 SP1 Design Tools English Version: 3.5.5692.0
QuickTime Version: 7.3.1.70
Microsoft Visual Studio 2008 Professional Edition - ENU Version: 9.0.21022
MSXML 6.0 Parser Version: 6.10.1129.0
Microsoft Windows SDK for Visual Studio 2008 SDK Reference Assemblies and Intell
iSense Version: 6.1.5288.17011
SQL Server System CLR Types Version: 10.0.1600.22
Microsoft SQL Server 2005 Express Edition (SQLEXPRESS) Version: 9.2.3042.00
Microsoft SQL Server Compact 3.5 for Devices ENU Version: 3.5.5386.0
Microsoft SQL Server VSS Writer Version: 9.00.3042.00
Microsoft Windows SDK for Visual Studio 2008 .NET Framework Tools Version: 3.5.2
1022
Microsoft Office Professional Edition 2003 Version: 11.0.8173.0
Microsoft Organization Chart 2.0 Version: 11.0.5614.0
Microsoft Office 2003 Proofing Tools Version: 11.0.8173.0
Microsoft Visual Studio 2005 Tools for Office Runtime Version: 8.0.60940.0
Crystal Reports Basic for Visual Studio 2008 Version: 10.5.0.0
Microsoft SQL Server 2005 Tools Express Edition Version: 9.2.3042.00
Microsoft .NET Compact Framework 2.0 SP2 Version: 2.0.7045
Security Update for CAPICOM (KB931906) Version: 2.1.0.2
FastTrace Plugin Wizard Version: 1.0.0
Microsoft .NET Compact Framework 3.5 Version: 3.5.7283
Symantec Client Security Version: 10.1.5010.5
Microsoft SQL Server Compact 3.5 SP1 English Version: 3.5.5692.0
Microsoft Document Explorer 2008 Version: 9.0.21022
Microsoft Windows SDK for Visual Studio 2008 Headers and Libraries Version: 6.1.
5288.17011
Windows Mobile 5.0 SDK R2 for Smartphone Version: 5.00.1700.5.14343.06
Microsoft SQL Server Database Publishing Wizard 1.2 Version: 1.2.0.0
Microsoft Silverlight Version: 1.0.30716.0
Microsoft .NET Framework 2.0 Service Pack 2 Version: 2.2.30729
Microsoft SQL Server Setup Support Files (English) Version: 9.00.3042.00
ActivePerl 5.6.1 Build 635 Version: 5.6.635
Microsoft Windows SDK for Visual Studio 2008 Tools Version: 6.1.5288.17011
<<<
|
|
|
|
|
Also, I need to get the version of an installation, not the individual assemblies within it.
For example, If I have a driver installer version 1.0. I may contain the following sets;
driverX.sys version 1.1
driverY.sys version 1.11
driverZ.sys version 1.12
Where is the Add/Remove feature in the control panel looking to obtain the 1.0?
Regards,
Matt
|
|
|
|