|
Yeah, you confused me there. If you are not using OpenFileDialog, then read up on the documentation of the code you are using or contact its provider. Chances are they intended to mimick OpenFileDialog though.
When a relative path (or just a file name) is specified, .NET (and Windows) will rely on the "Current Directory" which by default starts out to be the folder holding your EXE file; however there are many ways to change it on the go (and even at app start), so it is not a recommended way of doing things.
Better set things explicitly; also have a look at the "special folders", see Environment.GetFolderPath()
with SpecialFolder.ApplicationData and CommonApplicationData (you should use a folder hierarchy in there, based on your company name and/or product name).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Collin Jasnoch wrote: Bitmap bmp = new Bitmap(img); will not work if img is an absolute path.
Then something is wrong with your path. Did you confuse forward and backward slashes? are you referring to a case-sensitive file system (as in UNIX/Linux)? Did you forget a slash between path and name? Did you make a mistake in escaping a backslash?
Don't go the CD way if you don't have to, fix the real problem instead.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi, I need to change the BIOS configuration from c#, to enable or disable a Network Adapter.
Thanks
|
|
|
|
|
I have seen lots of articles/blogs on reading BIOS settings. I'm not sure that writing them is possible, could be, but I'm not sure.
In any event, would that be the right place for Network Adapter configuration?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks, but I need to write the BIOS to enable LAN.
|
|
|
|
|
After your first post, I did a little googling, and found this article[^]. It seems that you can treat the CMOS like ports 70 and 71, I assume one for reading and one for writing, though I could well be wrong on that.
Hope that it at least gives you some clues on how to proceed.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I don't know if this will help you, but take a look at this[^]. Click the first link to download the code.
It's got to be better than messing with the BIOS, one slip and you've got a doorstop.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks, but this code works if the network is enabled in the BIOS and doesn't work on Windows Vista. I need on Vista and XP.
|
|
|
|
|
Is there a way for a custom control on a form to tell if it's being called in design mode.
I tried using the DesignMode member in the constructor, but if the control is on a form in the designer DesignMode has a value of false.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
TopLevelControl.DesignMode?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
TopLevelControl doesn't have a DesignMode property.
Google's turned up a few fugly hacks, but there doesn't seem to be any supported way to check this from within the constructor itself.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Sorry, I didn't realize DesignMode is protected, not public.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
I found that after posting, it pukes if you're using something other than visual studio (eg sharpdevelop), and while I us MSVS and this is an internal app, I dislike that sort of thing on general principles.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Ok. How about checking EntryAssembly == YourApp?
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Wouldn't that cause it to fail if I renamed the app/used the control for a second app in the future?
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
You could test against Application.ExecutablePath.
This is getting complicated = would need some testing
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
no, this is getting complicated = add comment about MS stupidity and move code out of constructor.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
I found a solution not exactly what i was looking for, but it did help me someway.
My next question is How do I create a dynamic copy of datagridView only those row I am interested in. For example, I have a dataGridView it has 15 rows they are all not the same. So, I want to get only
dataGridView1.rows[i].cells[0].value are same.Means collects only those rows first cells has "x".
thanks again.
|
|
|
|
|
That would depend on where you are getting the data for your DataGridView from.
Is it from a database, a text file or where?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello friends
I want to create a chat room where people will be able to chat.
Users will also be able to Voice chat there just like a messenger.
If there is any code or example or any sort of thing that will help me making this please let me know.
I need to do this asap.
Thanking in advance
Johnny
|
|
|
|
|
Here[^] is a good example.
Basically, you can create a server application and a client application. Search 'client server applications', sure there are loads of samples. But, it wont be as easy as you want it to be
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Saiyed Alam wrote: I want to create a chat room where people will be able to chat.
Users will also be able to Voice chat there just like a messenger.
Yep, you and about 3 Million others.
You want to have a guess, how many of them actually manage to do it?
I estimate less than 0.005%. Why? Because it is exceedingly difficult thing to do a) properly and b) securely.
Good luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
FYI
Saiyed Alam wrote: I need to do this asap.
It's comments like that that get people's back's up. Just because you need it dosn't mean I ned to do it for you ASAP!
|
|
|
|