|
I agree that floppies are going out the window. With the flash drive being the choice portable data transport.
However CD-ROMs will be around for quite a while and since I never said that all machine have them, there are the select few who do not order them with their machines. Heck I even had a PC that had no floppy, harddrive, or CD-ROM. It had a boot ROM on the network card and booted from a boot file on the network. That was back awhile. No sure if they still do that.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote: However CD-ROMs will be around for quite a while and since I never said that all machine have them, there are the select few who do not order them with their machines. Heck I even had a PC that had no floppy, harddrive, or CD-ROM. It had a boot ROM on the network card and booted from a boot file on the network. That was back awhile. No sure if they still do that.
True. My point was that you can't just assume the CD drive is D:.
|
|
|
|
|
if nothing else try this:
<br />
try <br />
{<br />
string[] drives = System.IO.Directory.GetLogicalDrives();<br />
<br />
foreach (string str in drives) <br />
{<br />
System.Console.WriteLine(str);<br />
}<br />
}<br />
catch (System.IO.IOException) <br />
{<br />
System.Console.WriteLine("An I/O error occurs.");<br />
}<br />
catch (System.Security.SecurityException) <br />
{<br />
System.Console.WriteLine("The caller does not have the " +<br />
"required permission.");<br />
}<br />
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Check the type of the drive. If it's a removable drive you should skip it.
---
b { font-weight: normal; }
|
|
|
|
|
Yes, but I can't check the type of drive without obtaining the collection of drives:
ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * From Win32_LogicalDisk ");
ManagementObjectCollection queryCollection = query.Get();
after query.Get() on the second line, the A drive is checked even when there is no diskette.
|
|
|
|
|
You can always use this:
static public void Main(string[] args)<br />
{<br />
<br />
for (char driveLetter = 'A'; driveLetter <= 'Z'; driveLetter++)<br />
{<br />
DriveInfo drive = new DriveInfo(driveLetter.ToString());<br />
switch (drive.DriveType)<br />
{<br />
case DriveType.NoRootDirectory:<br />
break;<br />
default:<br />
Console.WriteLine("Found drive at " + drive + " of type " + drive.DriveType);<br />
break;<br />
}<br />
}<br />
}<br />
It will only make the annoying noise when you access the properties of the drive instance.
bool ready = drive.IsReady;
Like that.
|
|
|
|
|
This works on .NET 2.0, but I have to solve the problem on .NET 1.1
|
|
|
|
|
I wan to know the code for physical address(d:\songs) to a vitual address(\\172.13.23.987\songs) convertion in C#.
hiii
|
|
|
|
|
Is this virual address the IP address of the machine? How the virtual address is determined affects the answer to your question.
|
|
|
|
|
yes if i am in a system called \\hls-pc002 and store a wave file in d drive (which is shared)
hiii
|
|
|
|
|
Get the IP address of the local machine:
using System.Net;
...
IPAddress address = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0];
|
|
|
|
|
I came across the following window message codes sent to WndProc of the main form of a C# application. These messages are generated when the form starts up. There are no published WM_ constants for these. Does anyone have an idea what they represent?
UNKNOWN: 297 (H129)
UNKNOWN: 295 (H127)
|
|
|
|
|
You'd be more likely to get an answer to this in the c++ forum since hte msg codes are are win32api.
|
|
|
|
|
|
Those codes are Win32 macros for the Windows message pump. C++ applications have to handle them, C# (or .NET) ones don't. They are handle under the hood. If you want to have access to them, you override it in your Form-derived class.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Hi!
I have panel control and a picture box in it with SizeMode = Stretch. AutoScroll property of the Panel control is true. The picture box contains an image large enough to show the scroll bars of the panel control.
A rectangle is drawn over the image with different location and size.
Rectangle size always less than the display area of the panel control.
How can I scroll to the Drawn rectangle so that the drawn rectangle is completely visible in the Display area of the Panel control?
Thank You.
|
|
|
|
|
Hi.
How I can take a icon witch is asociated with file? I want to add it a ListView with fileName. Is there any quick way to compare two icons? I dont want to make a big table witch contains every icon in the folder, because lots of them are the same.
Thx!
|
|
|
|
|
You will have to use the Win32 API for that. It involves getting information about threads, modules, and processes and then using this info with Win32 function that will retrieve handle to file icon. It is not a cake walk if you have never worked with the Win32 before.
|
|
|
|
|
Hello everybody,
I have to integrate a webservice into a stand alone C# application. I do not have the WSDL but I have the URL of the Webservice, the service name, the operation name and the parameters (one single string containing a XML formated message). The web service returns the required information in the same parameter also formated as XML. The service is mounted with SOAP over RPC.
How can I do it? Do I try to create my own WSDL by hand?
Thank you to everybody who reads the message.
Best Regards,
Marcos
|
|
|
|
|
Since the tablelayout panel contains rows and columns, I thought that it would allow me to access them as myTLP.Columns[x] and such. It doesnt. I'm trying to dynamically hide(or remove, since it won't come back once its hidden) a column. I tried the msdn pages, but they weren't too much of a help. Can this even be done?
|
|
|
|
|
Hi
Can anyone tell me what i shud do if i want to rotate a rectangle with theKEYS OF THE KEYBOARD? using the function was ok, but how do i control its rotation wid the ARROW KEYS? It shud rotate counteclockwise wid the left arrow key and clockwise wid the rite one. I need desperate help!
Wil be grateful 2 whoeva does!
Wajeeha
|
|
|
|
|
Override the ProcessCmdKey method of your form, watch for an arrow press, update some angle variable in your form, repaint the rectangle with the new angle variable.
Next time try to write your post in clearer English, the following words are misspelled: Wil, whoeva, shud, wid, 2. Such poor spelling discourages anyone from replying seeing as how it makes you appear less intelligent.
|
|
|
|
|
Thank you for your help.
I shall try this also(By the way isn't ProcessCmdKey used in C++?). Meanwhile the program's style has been changed.
And my spellings are not poor. I am the champion of spellings in my university and I always have been throughout my studies. You can say I was taking liberty of net abbreviations, which everyone understands nowadays.
The program structure has now become as in to make 4 separate lines to draw the rectangle, and change its position using button-click.
I have already made the program, but it has one problem: I don't know how to call the DrawLine function in Button1_Click event. It gives me the following errors:
-first that I "No overload for method 'DrawLinePoint' takes '0' arguments" (like 'DrawLine()' ) .
-when I give arguments of p,Pt1, Pt2 it says they're classes and I should enter variables.
-When I give it the arguments Pen, Point, Point(And it is to check only) it says that "No overload for method 'DrawLinePoint' takes '3' arguments"!
-And I have a point to make here:-
**If I give it three arguments, shouldn't I write it 4 times? To make 4 lines I have to call it four times right?
Like this:
e.Graphics.DrawLine(blackPen,pt1,pt2);
e.Graphics.DrawLine(blackPen,pt2,pt4);
e.Graphics.DrawLine(blackPen,pt4,pt3);
e.Graphics.DrawLine(blackPen,pt3,pt1);
where blackPen is the name of the Pen, and pt1,2,3,4 are points.
I have defined all points. I have converted them into integers. And I don't know what else I have done. It was giving me 40 errors, after which it is now giving none, but it does as soon as I try to call DrawLine in Button_Click event.
I have used the Transform function also. It has no problems.
But obviously, it will only WORK if I call the DrawLine function first. Wish I could attach my file here.
I have also tried making a separate class, but I wouldn't call it a serious step.
I hope this time you'll not be able to find a flaw in my spellings.
All guidance in Graphics in Visual C#.Net is Welcome with advanced thanks.
Wajeeha
|
|
|
|
|
You culd alwys try the Matrix clss.... sorry, only messing about with the spelling.
Try the Matrix class. Create an instance of it, call the Rotate() method passing the new angle, then pass the matrix instance to the graphics object's Transform property, then call the graphics object's Draw routines as if you were drawing as normal. The Matrix class should convert your calls to DrawRectangle. Simply change the angle everytime the keyboard is pressed, then redraw.
For example
<br />
Graphics g = e.Graphics;<br />
Matrix matrix = new Matrix();<br />
matrix.Rotate( 45 );<br />
g.Transform = matrix;<br />
g.DrawRectangle( Pens.Black, x, y, width, height );<br />
By the way I've not tried this just yet, but I know it works when drawing lines.
Andy
|
|
|
|
|
Thank you for your help. I am using the Transform function, WITH the matrices made manually. I have done almost exactly as you've clued above.(By the way, how do we change the colors of text around here?)
Meanwhile the program's style has been changed.
I was taking liberty of net abbreviations, which everyone understands nowadays. And I did not know it's not liked here.
The program structure has now become as in to make 4 separate lines to draw the rectangle, and change its position using button-click.
I have already made the program, but it has one problem: I don't know how to call the DrawLine function in Button1_Click event. It gives me the following errors:
-first that I "No overload for method 'DrawLinePoint' takes '0' arguments" (like 'DrawLine()' ) .
-when I give arguments of p,Pt1, Pt2 it says they're classes and I should enter variables.
-When I give it the arguments Pen, Point, Point(And it is to check only) it says that "No overload for method 'DrawLinePoint' takes '3' arguments"!
-And I have a point to make here:-
**If I give it three arguments, shouldn't I write it 4 times? To make 4 lines I have to call it four times right?
Like this:
e.Graphics.DrawLine(blackPen,pt1,pt2);
e.Graphics.DrawLine(blackPen,pt2,pt4);
e.Graphics.DrawLine(blackPen,pt4,pt3);
e.Graphics.DrawLine(blackPen,pt3,pt1);
where blackPen is the name of the Pen, and pt1,2,3,4 are points.
I have defined all points. I have converted them into integers. And I don't know what else I have done. It was giving me 40 errors, after which it is now giving none, but it does as soon as I try to call DrawLine in Button1_Click event.
I have used the Transform function also. It has no problems.
But obviously, it will only WORK if I call the DrawLine function first. Wish I could attach my file here.
I have also tried making a separate class, but I wouldn't call it a serious step.
Help! I need a 3-D game programmer who can help me in my final year project!
Wajeeha
|
|
|
|