|
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.
This space for rent
|
|
|
|
|
Nice idea. Thanks
If it's not broken, fix it until it is
|
|
|
|
|
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;
pbCounter++;
pb.Location = new Point(pbWidth,pbHeight);
pb.Width = 100; pb.Height = 100;
pb.BackColor = Color.AliceBlue;
pb.Name =Convert.ToString(f);
pb.BackgroundImageLayout = ImageLayout.Stretch;
pb.MouseEnter += new System.EventHandler(PicBox);
}
}
void PicBox(object sender, EventArgs e)
{
}
This create last icon for exe files Screenshots:
[img]http:\\88.86.108.112\1.png[/img]
Files is directory
[img]http:\\88.86.108.112\2.png[/img]
Main probem
[img]http:\\88.86.108.112\3.png[/img]
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.
Thx
|
|
|
|
|
What is your question?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Right click the icon on the desktop.
Click Properties.
Click Shortcut.
Click "Change Icon..."
|
|
|
|
|
I have three pages
page 1 :through a submit button in page 1 ...
I want to be redirected in page2 in new tab and page3 in the same tab.
Is that possible?
Page1 contains :
using (MemoryStream memoryStream = new MemoryStream())
{
document.Save(memoryStream, false);
memoryStream.Position = 0;
Session["BinaryData"] = memoryStream.ToArray();
ScriptManager.RegisterStartupScript(this, this.GetType(), "openPDF", "javascript:window.open('../../Service/Pages/Page2.aspx');", true);
Response.Redirect('../../Service/Pages/Page3.aspx');
}
page2: to be opened in a new tab
protected void Page_Load(object sender, EventArgs e)
{
if (Session["BinaryData"] != null)
{
Response.Clear();
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "inline; filename=" + filename);
Response.BinaryWrite((byte[])Session["BinaryData"]);
}
then page 3:
will be redirected in the same tab
Thanks in advance
|
|
|
|
|
Start by taking out the javascript: protocol from your script registration:
ScriptManager.RegisterStartupScript(this, this.GetType(), "openPDF", "window.open('../../Service/Pages/Page2.aspx');", true);
That should get rid of the script error.
You'll then see a warning from the popup blocker in your browser, since your script is trying to open a new window, and it's not in direct response to the user clicking something on the page.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The Javascript opened the page2 if i commented the line of the
response.redirect to page3
but If I left it like that..
It goes to the page3 (response.redirect)
without opening page2 in the new tab (the register Javascript line)
|
|
|
|
|
Yes, a Response.Redirect will throw away all of the page content, and instead tell the browser to load a different page.
You'll need to remove the server-side redirection, and send back some script to redirect the page on the client:
ScriptManager.RegisterStartupScript(this, this.GetType(), "openPDF", "window.open('../../Service/Pages/Page2.aspx');", true);
ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect", "location.assign('../../Service/Pages/Page3.aspx');", true);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
This is working great in chrome ..
but in IE it is always blocked and I need to disable the Pop up blocker.
is any work around to avoid that in IE ?,
And Really Thanks and appreciate your help
|
|
|
|
|
No, there's no way to circumvent the popup blocker. If there was, it wouldn't be much use!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Damn, I just realised why my web dev looks at me funny when I ask him to use dialogs, in Silverlight they are just like a desktop dialog but I guess they are a popup window in ASP/MVC.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks alot ..
but the issue is
when the submit button is gone.. it is gone.. even the user allowed the pop up
the first page is redirected to page3 but the page2 is never opened in a new a tab.
and Page2 is actually a pdf document to be downloaded.. so I could never be able to download it .. in IE
Unless the popup block is not blocking me..
|
|
|
|
|
Hey all,
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.
|
|
|
|
|
|
Try this[^]. Not sure if it works and not able to give it a try atm, but a bit Googling pointed in that direction.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
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.
|
|
|
|
|
Holy crap.
ECHO %CLIENTNAME%
This variable only seems to exist from within RDP sessions.
That'll do.
[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...
modified 17-Feb-16 16:58pm.
|
|
|
|
|
I want to change the gliphicon button when pressed to show password and then after pressing it again get it back again?
|
|
|
|
|
Permission granted. Please, proceed.
Or did you forget to say what part of that you were having a problem with?
|
|
|
|
|
You can't just give him permission to proceed like that!
He hasn't even got a form 37/B/14 countersigned by Accounts yet!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Crap. I forgot, it's all about the red tape!
|
|
|
|
|
I have a file copy app. I need to determine if the app is running in-house (over the LAN) or is the client running remote.
What's the best way to determine this?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
We usually query the domain name of the current logged in user.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
That'll work...
Thanks!
If it's not broken, fix it until it is
|
|
|
|