c# opening up Picture folder

Today is my first day at learning C#, or any programming language so sorry if I get some terms wrong

I have a way of doing this but not the way I'd like and want to know if there's a better solution. Aim is, on my C# program, when you click a button, it opens up the Picture folder.

I use the following code to do so:

private void picBox_Click(object sender, EventArgs e) {     Process.Start("explorer.exe", @"C:\Users\MYUSERNAME\Pictures"); } 

The code works however where MYUSERNAME is, that is fixed. What if I was to run the program on another machine account where the username is different. Is there a way to auto detect the name?

Replay

Category: c# Time: 2016-07-31 Views: 89
Tags:

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.184 (s). 12 q(s)