hesaigo999ca
asked on
string tmp = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer) does not work
string tmp = Environment.GetFolderPath( Environmen t.SpecialF older.MyCo mputer)
does not work, as it resolves into "" which is not what I need, I need the actual path...
anyone know how to do this, with this virtual folder???
does not work, as it resolves into "" which is not what I need, I need the actual path...
anyone know how to do this, with this virtual folder???
MyComputer is not really a folder, what are you trying to do?
Hummm.... it works for me
Environment.GetFolderPath( Environmen t.SpecialF older.MyDo cuments) returns the full path to my "MyDocuments" folder.
Are you running this under the context of a User? (not a Web application, or service, etc)?
Environment.GetFolderPath(
Are you running this under the context of a User? (not a Web application, or service, etc)?
Emmet, that is MyComputer not MyDocuments.
Bob
Bob
MyComputer is the only SpecialFolder that doesn't map to a directory or folder name
hesaigo999ca,
Can you tell us why you need the path to the "My Computer" folder? What do you wish to do with it? Perhaps there is a way around the issue that topdog770 mentioned.
Thank you.
Jason
Can you tell us why you need the path to the "My Computer" folder? What do you wish to do with it? Perhaps there is a way around the issue that topdog770 mentioned.
Thank you.
Jason
ASKER
I know this...I have read some articles about how using the Browser Folder Dialog
to try and bypass this problem, however I still cannot resolve it....the example
is at http://www.xoc.net/works/tips/folderbrowserdialog.asp however I would need a string representation to pass into the axWebBrowser object for navigation purposes...
so it resolves to strings only and guess what microsoft does not have a string resolve to
MyNetwork, nor MyComputer....which sucks...these are the only 2 that I would need...
any ideas anyone...i will add more points if need be.
ps- that is correct the MyDocuments folder does work, just not the MyCOmputer folder...as it is virtual and resolves to ""
to try and bypass this problem, however I still cannot resolve it....the example
is at http://www.xoc.net/works/tips/folderbrowserdialog.asp however I would need a string representation to pass into the axWebBrowser object for navigation purposes...
so it resolves to strings only and guess what microsoft does not have a string resolve to
MyNetwork, nor MyComputer....which sucks...these are the only 2 that I would need...
any ideas anyone...i will add more points if need be.
ps- that is correct the MyDocuments folder does work, just not the MyCOmputer folder...as it is virtual and resolves to ""
ASKER
ps - if anyone can get the example I showed at http://www.xoc.net/works/tips/folderbrowserdialog.asp to resolve a string...
please post it and I will try this and accept it if it works...
Thanks in advance
please post it and I will try this and accept it if it works...
Thanks in advance
ASKER
I need the path to these folders as they are dynamic per user and each user has their own version of what is inside these folders...user a will have diff. network neighboorhood they user b on same machine
ASKER
hello?
Do you want to set the root folder for the FolderBrowserDialog?
Bob
Bob
ASKER
anything that can resolve into a hard coded path to place inside a string variable
I would accept something like FolderBrowserDialog.RootPa th.ToStrin g()....
if it actually resolved the path for the MyComputer / MyNetwork folders...
I have tried many ways so far without success...but the link at http://www.xoc.net/works/tips/folderbrowserdialog does not seem to work for me...
maybe I am doing something wrong....
any thoughts are welcome....
ps- how does anyone resolve this path when they create their own application ...using the win32 apis??? I would use this too, if it could resolve a string with the proper path to
the folders....
at this point I am up for anything...
I would accept something like FolderBrowserDialog.RootPa
if it actually resolved the path for the MyComputer / MyNetwork folders...
I have tried many ways so far without success...but the link at http://www.xoc.net/works/tips/folderbrowserdialog does not seem to work for me...
maybe I am doing something wrong....
any thoughts are welcome....
ps- how does anyone resolve this path when they create their own application ...using the win32 apis??? I would use this too, if it could resolve a string with the proper path to
the folders....
at this point I am up for anything...
That wasn't an explanation--it only confused me more.
1) It sounds like you are still trying to get a hard path My Computer and My Network, which isn't possible.
2) The FolderBrowserDialog.RootFo lder is an enum that tells the dialog which folder to set as the root for the dialog.
3) So, what are you really trying to do?
Bob
1) It sounds like you are still trying to get a hard path My Computer and My Network, which isn't possible.
2) The FolderBrowserDialog.RootFo
3) So, what are you really trying to do?
Bob
ASKER
so far I can get the example to set the proper folder path in the folderbrowserdialogue, but I cant get a string representation of this path, only "18"...which I guess is the hexidecimal value passed in as CsIdl.Network...
any thoughts on how to get that string?
any thoughts on how to get that string?
Why do you need a string representation? You still haven't gotten to the root of that question? What are you going to do with that string?
I am going to keep asking this question, until I get a good answer, and I haven't heard one yet.
Bob
I am going to keep asking this question, until I get a good answer, and I haven't heard one yet.
Bob
ASKER
I have already answered this question...because the axWebBrowser object's
navigate method only accepts strings...and it is capable of going unto the user's local
machine just like IE, so therefor this would allow me to open up web pages,
http:// etc.... and files...c:\windows.... except that the virtual representation of
ceratin folders are not available in the Environment.SpecialFolder enumerations...
which leads me to this post....hopefully someone out there has already worked on this and has gotten this to work....a proper string representation of the folder selected
in the SetRootFolder example shown above
Hope this explains all...
navigate method only accepts strings...and it is capable of going unto the user's local
machine just like IE, so therefor this would allow me to open up web pages,
http:// etc.... and files...c:\windows.... except that the virtual representation of
ceratin folders are not available in the Environment.SpecialFolder enumerations...
which leads me to this post....hopefully someone out there has already worked on this and has gotten this to work....a proper string representation of the folder selected
in the SetRootFolder example shown above
Hope this explains all...
Ok, with all that said over and over again, there isn't an easy way to do this with the web browser control. My Computer and My Network are not folders. There might be a WinAPI call, but we would have to find it.
Bob
Bob
ASKER
...I just thought there might be a property in the FolderBrowserDialogue that I could
access after Setting its RootFolder....to get a string to use???
access after Setting its RootFolder....to get a string to use???
ASKER
funny...i thought this would have been easy for the more hardcore developers that have worked with c++ and accessed those hard to get informations from windows...
Sorry, not a hardcore C++ developer.
Bob
Bob
const string MyComputer = "::{20D04FE0-3AEA-1069-A2D 8-08002B30 309D}";
const string MyDocuments = "::{450D8FBA-AD25-11D0-98A 8-0800361B 1103}";
const string MyNetworkPlaces = "::{208D2C60-3AEA-1069-A2D 7-08002B30 309D}";
const string Printers = "::{2227A280-3AEA-1069-A2D E-08002B30 309D}";
const string RecycleBin = "::{645FF040-5081-101B-9F0 8-00AA002F 954E}";
const string Tasks = "::{D6277990-4C6A-11CF-8D8 7-00AA0060 F5BF}";
System.Windows.Forms.OpenF ileDialog dlg = new OpenFileDialog();
dlg.InitialDirectory = MyComputer;
dlg.ShowDialog();
const string MyDocuments = "::{450D8FBA-AD25-11D0-98A
const string MyNetworkPlaces = "::{208D2C60-3AEA-1069-A2D
const string Printers = "::{2227A280-3AEA-1069-A2D
const string RecycleBin = "::{645FF040-5081-101B-9F0
const string Tasks = "::{D6277990-4C6A-11CF-8D8
System.Windows.Forms.OpenF
dlg.InitialDirectory = MyComputer;
dlg.ShowDialog();
And, how does that work with the WebBrowser's Navigate method?
Bob
Bob
That's what I was just going to try out!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Very cool--great job!!!
Bob
Bob
Where did you find the reference to that magic?
Bob
Bob
wow... let me think...
sorry.. almost always provide links back.
http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic20578.aspx
http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic20578.aspx
Right into my bag-o-tricks went that code in a different form.
Thanks,
Bob
Thanks,
Bob
Anytime, anyone can provide you with a new piece of information, it's a great day to be alive!!
How do you store all the information and data you've collected here?
How do you store all the information and data you've collected here?
2003 = project with multiple single-purpose classes, 2005 snippet manager
Bob
Bob
cool, thanks.. haven't played with the snippet manager at all, yet.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am increasing the points seeing as you both have had a hand in it, topdog with being able to get a string representation (codus to u dude) and thelearnedone with having a full implementation with enumerations and all, I will accept both and split...
thanks guys....and by the way, I have to say this is not documented anywhere on microsoft's
website, are these strings/resolutions from the registry, do they have more mappings then just the ones you have listed here...and where could i find the reason why this works, and not the Environment.SplecialFolder etc...
Thanks again guys...
thanks guys....and by the way, I have to say this is not documented anywhere on microsoft's
website, are these strings/resolutions from the registry, do they have more mappings then just the ones you have listed here...and where could i find the reason why this works, and not the Environment.SplecialFolder
Thanks again guys...
The registry key is:
Name = My Computer
HKEY_CLASSES_ROOT\CLSID\{2 0D04FE0-3A EA-1069-A2 D8-08002B3 0309D}
There are 3 keys:
InfoTip
IntroText
LocalizedString
Each of these values use a call to @%SystemRoot%\system32\SHE LL32.dll, with an numeric identifier:
Example for MyComputer: @%SystemRoot%\system32\SHE LL32.dll,- 9216
You can look for @%SystemRoot%\system32\SHE LL32.dll in the registry, and any of the 3 keys, and see what the name of the folder is.
Bob
Name = My Computer
HKEY_CLASSES_ROOT\CLSID\{2
There are 3 keys:
InfoTip
IntroText
LocalizedString
Each of these values use a call to @%SystemRoot%\system32\SHE
Example for MyComputer: @%SystemRoot%\system32\SHE
You can look for @%SystemRoot%\system32\SHE
Bob
ASKER
You guys amaze me, everytime...I love this website....I just wish that more
of the veterans would help share their knowledge, as I find sometimes, not everyone is
willing to go the extra mile.....
thanks again to the both of you, and thanks for that explanation, it makes sense now, as I am reading the registry as we speak to see what other virtual paths
they have aside from the ones listed here.....you learn soemthing new and important everyday!
: )
of the veterans would help share their knowledge, as I find sometimes, not everyone is
willing to go the extra mile.....
thanks again to the both of you, and thanks for that explanation, it makes sense now, as I am reading the registry as we speak to see what other virtual paths
they have aside from the ones listed here.....you learn soemthing new and important everyday!
: )
Well, if I go the extra mile, then I can learn something new myself, so that I can keep my reputation as "The Learned One".
Bob
Bob
ASKER
; )
ASKER
More easy points over at https://www.experts-exchange.com/questions/21926457/I-need-to-convert-dataset-to-html-quickly.html
in case you guys wanted some more points...
in case you guys wanted some more points...