As you might surmise, you report progress back with an instance of IProgress. When you created it, you limited it to being a double - why not create a structure that encapsulates the double and the filename, and pass this across instead? Then, when you are reporting the progress back, you would need to report progress using this structure instead of just the double.
Hi can you please help me, with main problem. I am try create own menu for disabled peoples. Here is code:
PictureBox pb = new PictureBox();
int pbCounter = 0;
int pbWidth = 100;
int pbHeight = 100;
void MainFormLoad(object sender, EventArgs e)
DirectoryInfo dir = new DirectoryInfo(@"otherapp\");
foreach (FileInfo f in dir.GetFiles("*.exe"))
pbWidth = pbWidth+10;
pb.Location = new Point(pbWidth,pbHeight);
pb.Width = 100; pb.Height = 100;
pb.BackColor = Color.AliceBlue;
pb.BackgroundImageLayout = ImageLayout.Stretch;
pb.MouseEnter += new System.EventHandler(PicBox);
void PicBox(object sender, EventArgs e)
This create last icon for exe files Screenshots:
Files is directory
This i want have.
When i have 5 exe files is directory otherapp\ create 5 icon on "dekstop" with names of exec files. And when i am click on icon on "desktop" executet this software.
response.redirect to page3
but If I left it like that..
It goes to the page3 (response.redirect)
If I'm on MachineA and remote into MachineB using Terminal Services (remote desktop / mstsc.exe), is it possible for a process that's then launched on MachineB to tell that the user is actually connected from MachineA?
I suspect it's possible, as Task Manager's Users tab can show User/ID/Status/Client Name/Session. What I'm after is Client Name.
This jumps through a lot of hoops to determine the name of the machine the code is running on. What I'm after is the name of the machine the user is remoting from.
Local/remote in this context gets confusing. I'm on OfficePC. I use Remote Desktop to log into ServerMilesAway. I run my app. My app knows (Environment.MachineName) it's running from ServerMilesAway, and I can log that and whatever. But I want my log to also show that the user who launched my app is actually back on OfficePC (not the user's name, which I can already get, but the machine name that started the remote session).
Task Manager can do that. I'd like to be able to do the same.
This variable only seems to exist from within RDP sessions.
[Edit] This is the case on Windows 7, but it's still not there on Windows 10. WTF?
[Edit #2] If anyone cares:
Don't know why Microsoft took it out. But the session ID (an int) can be obtained from GetCurrentProcess().SessionId. Once I have this ID, I can go to HKEY_CURRENT_USER\Volatile Environment[SessionID]\CLIENTNAME. That seems to work consistently.
I'm not a huge fan of this solution, but it works so far...