|
Your question is vague and confusing.
Yanshof wrote: I need to write something to the command line and i don't know how to do it.
I try to use "Console.WriteLine(...)" but i cant get the result that i need.
I want to give some path ( for example C:\SomeFolder) and this folder will be open ( like enter same line to the Start->Run line ).
Do you want to open an explorer window to that path? Using Console.WriteLine?
|
|
|
|
|
No,
I dont need any explorer or opening file.
I need to send some command to the command line - and by this to turn on some DOS application with some parameters.
I dont know how to do it.
|
|
|
|
|
Yanshof wrote: I need to send some command to the command line
Do you mean you need to start a new process?
Look at the Process class, it allows you to create new processes and send them command line arguments.
|
|
|
|
|
No, Its not a new process...
But Thanks any way.
|
|
|
|
|
Well what then?
Once your application is running you have no command line. If you want to run something "at the command line" then you have to start a new process. That is what running something at the command line does. It starts a new process.
|
|
|
|
|
Hi Friends how to change image formate from jpeg,gif etc to bitmap type in c#. I have to change color of image from one color to another color for that i req. bitmap file formate image only so how i can convert image to .bmp ?
thanks in advance.
|
|
|
|
|
If you read the bitmap into a System.Drawing.Bitmap, then save it to a file name with a ".bmp" extension, it will be converted to a bitmap type.
|
|
|
|
|
Hi,
I have a problem if I read CPU ID and HD serial number with P/Invoce.
It possible read this property with .NET 2.0 class?
Help me please ( possible with example )
Thanks a lot!
Alex
|
|
|
|
|
Yes
try this
Public Class Processor_ID
Public Function Get_CPU_ID() As String
Try
Dim objMOS As ManagementObjectSearcher
Dim objMOC As Management.ManagementObjectCollection
Dim objMO As Management.ManagementObject
objMOS = New ManagementObjectSearcher("Select * From Win32_Processor")
objMOC = objMOS.Get
For Each objMO In objMOC
MessageBox.Show("CPU ID = " & objMO("ProcessorID"))
Next
objMOS.Dispose()
objMOS = Nothing
objMO.Dispose()
objMO = Nothing
Catch ex As ApplicationException
MessageBox.Show(ex.Message)
End Try
End Function
End Class
and Call the Function like this
in your Form
Dim strId As String
Try
Dim objID As New Processor_ID
strId = objID.Get_CPU_ID()
MessageBox.Show(strId)
Catch ex As ApplicationException
MessageBox.Show(ex.Message)
End Try
And that is in vb, its easy to convert it to C#
Hope it Helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
|
Hi I am adding several labels and textboxes at runtime in a panel. How can i get only the text present in the textboxes? That is i need to identify the textboxes only. thanks
|
|
|
|
|
Iterate through each controls in panel and check it is a textbox.
foreach(Control control in panel.Controls)
{
if(control is TextBox)
{
(control as TextBox).Text;
}
}
|
|
|
|
|
|
HI,
Any one who can help me. how can i get a file icon, all i have are a filenames. I read about SHFILEINFO, but is there other way of retrieving the icons with out using that one?]
I'm doing a 'windows explorer'-like application in c#,web application.
Thanks!
|
|
|
|
|
I dont think so. SHFILEINFO seems to be the best way, otherwise you could analyse the registry and try to retrieve the values from there.
Der Staat mit der niedrigsten Geburtenrate ist nicht die Bundesrepublik, sondern der Vatikan.
|
|
|
|
|
|
hai,
how to do vote rating concept in .net with c#.if you know the concept or link send to me..
thank you.
|
|
|
|
|
If we understood the question it would help.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hello everyone,
For this best practices rule,
http://msdn.microsoft.com/en-us/ms182172.aspx
What are the benefits of following this rule even if I am not wrapping an unmanaged resource, like FileStream in the sample in the page.
I think it is fine if the class does not implement IDisposable, since FileStream could be disposed (to release the native file handle) since it has its own Dispose method. Any ideas?
thanks in advance,
George
|
|
|
|
|
George_George wrote: What are the benefits of following this rule even if I am not wrapping an unmanaged resource,
No benefit. If you have nothing to dispose, why implement IDisposable ?
|
|
|
|
|
Thanks N a v a n e e t h!
In the MSDN sample, what is the benefit of class HasDisposeMethod, if it implements IDisposable (as shown in the sample)?
regards,
George
|
|
|
|
|
It wraps FileStream and provides dispose pattern to dispose FileStream instance. In that example, they have initialized FileStream, but not disposing after use. When you call Dispose() on a HasDisposeMethod instance, FileStream instance will get disposed. If HasDisposeMethod was like the following, no need of IDisposable implementation.
public class HasDisposeMethod
{
public HasDisposeMethod()
{
}
public void UseFileStream()
{
using(FileStream newFile = new FileStream(@"c:\temp.txt", FileMode.Open))
{
}
}
} In the above example, FileStream instance is used and disposed after user. So no need to provide dispose interface.
|
|
|
|
|
Thanks N a v a n e e t h,
Great reply! One further question, for the original sample in the MSDN page, if it does not implement IDisposable, what are the issues?
regards,
George
|
|
|
|
|
FileStream won't be disposed until GC collects.
|
|
|
|
|
Thanks N a v a n e e t h!
So, you mean the benefit is -- if the wrapper class implements IDispoable, we could enforce "using" block on the wrapper class to Dispose the resource immediately?
regards,
George
|
|
|
|