473,378 Members | 1,209 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Saving a File to the Desktop

I want to be able to save a file to the Desktop. I realise the Desktop
path varies according to the version of Windows being used. Can
some-one help me with the following three issues:
1. Is the best option to use 'Environment.OSVersion.Version.Major' to
determine which version of Windows?
2. What values do each of the Windows versions have for point 1 above?
3. I know the path for XP (C:\Documents and Settings\" & strUserName &
"\Desktop\) and for Windows 98 (C:\Windows\Desktop\), but can anyone
help me what the paths for the other Windows versions would be?

With thanks

Apr 12 '06 #1
2 2672
"Devlei" <de****@eastcape.net> schrieb:
I want to be able to save a file to the Desktop. I realise the Desktop
path varies according to the version of Windows being used.
[...]
3. I know the path for XP (C:\Documents and Settings\" & strUserName &
"\Desktop\) and for Windows 98 (C:\Windows\Desktop\), but can anyone
help me what the paths for the other Windows versions would be?


'Environment.GetFolderPath(Environment.SpecialFold er.Desktop)' should return
the correct path on all versions of Windows supported by the .NET Framework.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 12 '06 #2

"Devlei" <de****@eastcape.net> kirjoitti
viestissä:11*********************@j33g2000cwa.goog legroups.com...
I want to be able to save a file to the Desktop.


Just use

Dim deskDir As String =
Environment.GetFolderPath(Environment.SpecialFolde r.DesktopDirectory)

That should give you desktop folder.
Apr 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: john bailo | last post by:
For a c# program to automatically extract information from email attachments using the Outlook 9 OM, rather than saving to a file, then reading the file, I would prefer to 'Save' the attachment to...
0
by: marfi95 | last post by:
I'm automating a piece of my app to allow my customers to send me a copy of their event logs (for diagnostics) on demand just through the click of a button. I know I can use the...
7
by: juli | last post by:
I want to save file ,using the SaveFileDialog control, in such way that uploaded file will be saved always as "text.txt" and always in c:\Text folder. How do I do it? Thank you a lot and Happy...
4
by: zombek | last post by:
I'm making a small program which takes a folder with images and generates optimized normal-sized images and thumbnails using Python Imaging Lbrary (PIL). The problem is here: ........
2
by: zorro | last post by:
Hello, When I upload an image to the server I get the message: Warning: Only -1 bytes were written, expected to write 547 The server phpinfo lists : file_uploads On
6
by: Mark Denardo | last post by:
My question is similar to one someone posted a few months back, but I don't see any replies. Basically I want to be able to have users upload photos and save them in a database (as byte data)...
1
by: John | last post by:
Hi I am using an open file dialog which allows me to select a file to open. This is all great. But it does not allow me to give a filename and select folder to save the file to if the file does...
0
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, We have a legacy asp application that uses a third party component to upload a file and saves it to a secure network share. The code sets the credentials for the secure network share on the...
2
by: deathprincess | last post by:
Hi, I'm writing a code in c# that will export a table to excel file ".xls". I want to save every file with different filename and worksheets of each as sheet 1. i have no idea how to format the...
5
by: JohnLorac | last post by:
Hello, can somebody help me with saving file into local disk using javascript? I made some sample code which unfortunately won't work :(. Applet sample file: public class IO extends...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.