|
hi,
I wanted to know if i get drives using the function "System.Environment.GetLogicalDrives()",then is there any methods which can tell which drive is what?Say i wanted to know whether "D:" is CDROM or the hard disk drive.
Can anybody help me?
Thanx in advance.
Nitin_ap
nitin_ap
|
|
|
|
|
Use DriveInfo class for that...
Regards
Hansjörg
|
|
|
|
|
|
Hello I have a question regarding to serializing objects.
I have a class which has a property with an object which implementents a interface.
This class is included in a class library. The object is included allways in other projects and is allways different.
Is there a way to serialize this objects automatically ( I use the XmlSerializer)?
e.g.
<br />
[Serializable]<br />
public class SerializeTestObject<br />
{<br />
public int x = 0;<br />
public int y = 10;<br />
}<br />
<br />
[Serializable]<br />
public class SerializeVisualObject :ISerializable<br />
{<br />
private Rectangle bounds;<br />
private Color foreColor = Color.Red;<br />
private Color backColor;<br />
private object obj = new SerializeTestObject();
<br />
public SerializeVisualObject() { }<br />
<br />
protected SerializeVisualObject(SerializationInfo info, StreamingContext context)<br />
{<br />
bounds=(Rectangle)info.GetValue("Bounds", typeof(Rectangle));<br />
foreColor=(Color)info.GetValue("ForeColor", typeof(Color));<br />
backColor=(Color)info.GetValue("BackColor", typeof(Color));<br />
obj = new SerializeTestObject();<br />
}<br />
public object Obj<br />
{<br />
get { return obj; }<br />
set{obj = value;}<br />
}<br />
public Rectangle Bounds<br />
{<br />
get { return bounds; }<br />
set { bounds = value; }<br />
}<br />
<br />
public Color ForeColor<br />
{<br />
get { return foreColor; }<br />
set { foreColor = value; }<br />
}<br />
<br />
public Color BackColor<br />
{<br />
get { return backColor; }<br />
set { backColor = value; }<br />
}<br />
<br />
#region ISerializable Members<br />
<br />
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)<br />
{<br />
info.AddValue("Bounds", bounds);<br />
info.AddValue("ForeColor", foreColor);<br />
info.AddValue("BackColor", backColor);<br />
info.AddValue("Obj", obj);<br />
}<br />
<br />
#endregion<br />
}<br />
<br />
Regards
Hansjörg
|
|
|
|
|
I have this code in a combobox:
switch (comboBox1.SelectedIndex)
{
case 0: MessageBox.Show("Windows Longhorn 1 (1024x768)"); pictureBox1.Image = System.Drawing.Image.FromFile("Themes\\Wallpapers\\Windows Longhorn\\windows longhorn (1024x768).jpg"); break;
case 1: MessageBox.Show("Windows Longhorn 1 (420x336)"); pictureBox1.Image = System.Drawing.Image.FromFile("Themes\\Wallpapers\\Windows Longhorn\\windows longhorn (420x336).jpg"); break;
case 2: MessageBox.Show("Windows Longhorn Define the digital decade (1024x768)"); pictureBox1.Image = System.Drawing.Image.FromFile("Themes\\Wallpapers\\Windows Longhorn\\Windows Longhorn Define the Decade (1280x1024).jpg"); break;
case 3: MessageBox.Show("Windows Longhorn M6 Build Orange (800x600)"); pictureBox1.Image = System.Drawing.Image.FromFile("Themes\\Wallpapers\\Windows Longhorn\\New Longhorn orange M6 (800x600).jpg"); break;
case 4: MessageBox.Show("Windows Longhorn M6 Build Orange (1024x768)"); pictureBox1.Image = System.Drawing.Image.FromFile("Themes\\Wallpapers\\Windows Longhorn\\New Longhorn orange M6 (1024x768).jpg"); break;
}
What I want is when you click btnOK (Button OK) it will load the image you selected from the file eg: pictureBox1.Image = System.Drawing.Image.FromFile("Themes\\Wallpapers\\Windows Longhorn\\New Longhorn orange M6 (800x600).jpg"); and display the image from this file in a picturebox pctWall in another form that is loaded. How would you do that?
In the end we're all just the same
|
|
|
|
|
Who can tell me the differences between control and ContainerControl or give some useful articles.
It confused me.Help please.... Thanks a lot.
|
|
|
|
|
As i think you can take a simple example of control DataGrid and for container control Repeater. In a repeater you can have many grid controls.
for more information about those check the following link
http://www.asp101.com/articles/john/repeater/default.asp
|
|
|
|
|
I've just downloaded .net 2.0 so that I can use the serial ports offered in the IO.Ports dll but I cannot find it. Does anybody know where I would find this.
Thanks
Garry
|
|
|
|
|
gokeeffe wrote: IO.Ports dll
I don't know of any such thing as an IO.Ports dll, but maybe System.IO.Ports is what you are looking for. There is a SerialPort object in this namespace.
Search for it in the obect browser.
Summary:
The System.IO.Ports namespace contains classes for controlling serial ports. The most important class, System.IO.Ports.SerialPort, provides a framework for synchronous and event-driven I/O, access to pin and break states, and access to serial driver properties. It can be used to wrap a System.IO.Stream objects, allowing the serial port to be accessed by classes that use streams.
----------
There go my people. I must find out where they are going so I can lead them.
- Alexander Ledru-Rollin
|
|
|
|
|
Thanks, I can find this using a downloaded version of visual C# express but I really wanted to use Visual Studio.Net 2003.
I have installed .Net 2.0 but I cannot find the IO.Ports in the 'Customise Toolbox' dialog in Visual Stidio.
I think my question should have been 'How do I make Visual Studio 2003' use .net 2.0.
Thanks for your help.
Garry.
|
|
|
|
|
|
Thanks for your help, it looks conclusive that it can't be done.
|
|
|
|
|
This is a VB.Net sentence,How to realize in c#?
PHDObject = CreateObject("VisualPHD.Data")
|
|
|
|
|
|
PHDObject = Activator.CreateInstance(Type.GetType("VisualPHD.Data"));
|
|
|
|
|
hey guys,
i need to beable to interact with the CodeBase database from my C# application. please tell me its easy and tell me its free?
Regards
|
|
|
|
|
:-DI want to draw a select rectangle use mouseEvents in panel,with some drawings already existing.
At first I used MouseDown ,MouseMove and MouseUp events to draw this rectangle with solide pen,however on MouseMoveEvent,when I use a pen(with backColor)to erase the last rectangle MouseMoveEvent generated,the existing drawings are erased too.then ,I used invalidate(),but the drawings flashed.
All I want is just draw a rectangle with a Dash pen and the existing drawings not flashing,just like the selecting rectangle in WinXP deskTop.
Thanks.
-- modified at 2:13 Wednesday 8th March, 2006
|
|
|
|
|
Try using double buffering, this will probably solve the flashing.
|
|
|
|
|
Thanks for your help.the problem has been solved;
Guided by your reply,I set the control's ControlStyles.UserPaint|ControlStyles.AllPaintingInWmPaint|ControlStyles.DoubleBuffer to be true.and it works.
|
|
|
|
|
If you use .NET 2.0 you can also use this.DoubleBuffered = true
|
|
|
|
|
hi guys, any one of you can tell me how can i made my software as a trial version, i dont how do i initiate to make it trail version, any one of you please guide me.
Thanx
Raheel Iqbal
-- modified at 1:36 Wednesday 8th March, 2006
|
|
|
|
|
Hello Raheel,
There is many way to make your software trial version.
1) Use registry key.
---> Here you se one of key value in registry releted to date. & decrease by one
each day releted to current day.
2)Generate a key & statically bind it to your code.
---> Here you can generate a key & do no store it anywhere but just give it within your program code. If user key is not by program then user get limied access of your software.
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
Can you send me the code please if you have cause i dont have a little bit idea about it im very thankful to you
Raheel Iqbal
|
|
|
|
|
Hello everyone,
I used to have my MS Access 2002 DataBase placed in my application folder and connect to it through an OLEDB connection. Everything worked fine.
Now I decided to create an ODBC DataSource and suddenly I'm not able to pass parameters to the SQL Query the way I used to with the OLEDB connection.
Here's a sample code of the SQL Query and C# code on my form:
FillByClienteDataNumero query:
SELECT Data, Cliente, Tipo, Número, Espécie, Lote, Análise, Preço
FROM qryALL1
WHERE (Cliente = ?) AND (Data >= ?) AND (Data <= ?) AND (Tipo = ?)
ORDER BY Data, Número
Form code:
private void btnSeekBA_Click(object sender, EventArgs e)
{
try
{
this.qryALL1TableAdapter.FillByClienteDataTipo(this.sascrDataSet.qryALL1, cbCliente.Text, new System.Nullable<system.datetime>(((System.DateTime)(System.Convert.ChangeType(DataIni.Text, typeof(System.DateTime))))), new System.Nullable<system.datetime>(((System.DateTime)(System.Convert.ChangeType(DataFin.Text, typeof(System.DateTime))))), "Boletim");
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
Any ideas why the above SQL query and code work with an OLEDB connection but not with an ODBC DataSource? Thanks a million!
JC.
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
Standard question #2:
What error message do you get?
---
b { font-weight: normal; }
|
|
|
|