The copying code is called on a background thread while the Progress Bar is being updated via the main or UI thread.
Thus, you see the effect of the progess bar incrementing while the file is being copied.
In an existing C# 2008 windows application I am trying to decide how to use the existing application without rewriting it. Currently there is a 'driver C# 2008 windows' program that calls the 'main C# 2008 desktop' application to perform various caLLS to a third parfty web service.
Now I would like to use the 'main C# 2008 desktop' application to be run by users. The users would enter the required paramters in a desktop screen and/or possibly a dos popup window. The application would know who is running the program by the paramters that are passed to the application.
Thus my question is, can a desktop screen and/or a dos popup window show up when users click on the executable? The default would be for the no desktop window to show up when the program is called by the 'driver C# 2008 windows' program.
Thus can you show me code and/or point me to urls that would show me how to accomplish this goal? If my goal not realistic, can you suggest other ways that I can accomplish the add on goal I am trying to acheive?
Errrr, dcof, you're posting under your other account again. Honestly, I don't know why you're still persisting with this architecture. We told you, when you first started posting about this under your many accounts, that it's not a good design and that you should seek to replace the second console application as it's unnecessary. You are tying yourself in knots here, trying to fix this broken application.
I was brought up to respect my elders. I don't respect many people nowadays.
i am getting an error: unexpected end of file on the line that contains databaseKeyValue. Not sure why that is the case. Any help will be greatly appreciated.
bool itemsAdded = false;
// Add the shapes to the drawing page. The returned list contains
// the shape IDs of the added shapes.
addShapesToDrawing(drawingPage, out shapeIDs);
if (shapeIDs != null)
// Loop through each new shape, adding the shape to the map.
for (int index = shapeIDs.GetLowerBound(0);
index <= shapeIDs.GetUpperBound(0);
// Get the shape.
short shapeID = (short)(int)(shapeIDs.GetValue(index));
Visio.Shape newShape = drawingPage.Shapes.get_ItemFromID(shapeID);
// Add the shape to the map.
// This is needed to connect the shapes.
// The primary key in the database is used in the database
// connection table, so we need to save the mapping from
// this database key to the corresponding shape. The
// database key value was placed into each shape's Prop.ID
// value when the database-linked shapes were added to the
int databaseKeyValue = newShape.get_Cells(_VisioPropCellPrefix + _IDColumn).get_ResultInt((short)Visio.VisUnitCodes.visNumber, 0);
itemsAdded = true;
i have designed a table as shown below. the are two literal controls as i am binding the datatable to the literal contol creating a tabular structre in the page load itself. The data is displayed correctly in default.aspx page. i want to export this aspx page to pdf . I using Itextsharp.dll.
On button click i have written code. The PDF is generated but it is getting distorted. Not getting generated as per the displayed aspx page.
I suspect iText is choking because of either invalid HTML, or all your nested tables are just too complicated for it. Post the final markup (view source) of your page so we can check it for known iText errors. One unclosed tag will mess it up bad.
Do you need file access to take place in the context of the actual user who is on the web site? Or, is this a situation where access to the web site means access to the files? If you need the Windows admins to control access to these files, then yes you need to use impersonation, but if you don't need that, it would be much easier to just stream the file back over HTTP. In that case file access would be done by the ASP_NET User, so you would only need to grant one user access to the folder. In the impersonation case, you have to add users to groups and whatnot to manage access to that folder.
Streaming a file back is super easy...
var file = File.Open(path);
Response.ContentType = "application\xml"; //or whatever it is
I think the answer you may be looking for is in the region of encryption and decryption.
Basically it boils down to never storing a clear text password - use something similar to the crypto class described here[^].
“That which can be asserted without evidence, can be dismissed without evidence.”
I'm creating an application that will allow me to draw lines with the mouse and then save them to a file in a graphical format. By dint of trying and trying I have come to the code.
The last problem that I can not solve is that I can only save the 'background' of the image but not the drawed shape.
The program consists of a PictureBox1 and a button1, drawing with the left mouse button, closes the shape with the right button and save the.
Thanks in advance to those who want to give me a tip.
publicpartialclass Form1 : Form
GraphicsPath path = new GraphicsPath();
g = pictureBox1.CreateGraphics();
redPen = new Pen(Color.Red, 2);
blackPen1 = new Pen(Color.Black, 1);
blackPen2 = new Pen(Color.Black, 2);
orangePen = new Pen(Color.Orange, 1);
bm = new Bitmap(pictureBox1.Width, pictureBox1.Height);
privatevoid Form1_Load(object sender, EventArgs e)
pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox1_Paint);
pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown);
Shown += Form1_Shown;
privatevoid Form1_Shown(Object sender, EventArgs e)
private List<Point> polygonPoints = new List<Point>();
privatevoid pictureBox1_MouseDown(object sender, MouseEventArgs e)
polygonPoints.Add(new Point(e.X, e.Y));
if (polygonPoints.Count > 1)
path.AddLine(polygonPoints[polygonPoints.Count - 2], polygonPoints[polygonPoints.Count - 1]);
if (polygonPoints.Count > 2)
g.FillPath(new SolidBrush(Color.Orange), path);
privatevoid pictureBox1_Paint(object sender, PaintEventArgs e)
Graphics g = Graphics.FromImage(bm);
// Draw grid
for (int i = 0; i < pictureBox1.Width; i += 10) g.DrawLine(blackPen1, i, pictureBox1.Height, i, 0);
for (int i = 0; i < pictureBox1.Height; i += 10) g.DrawLine(blackPen1, 0, i, pictureBox1.Width, i);
g.DrawLine(blackPen2, 0, pictureBox1.Height - 90, pictureBox1.Width, pictureBox1.Height - 90);
e.Graphics.DrawImageUnscaled(bm, 0, 0);
privatevoid button1_Click(object sender, EventArgs e)