|
Sorry mate, haven't tried that actually, but I could assume doing it by separating file stream writings and get the total free space left after closing the stream after writing each file of the process.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Thanks Muammar,
the write process is managed by a pure command line process, hence i cannot distinguish the streams.. The only option I have is to keep monitored the disk space being written, but the process.start is on the same thread than the GUI, hence the GUI is locked during the process.
It gets refreshed only once the process ends.
I'm trying a way to launch the command line process on a separate thread, keeping the GUI free to refresh.
|
|
|
|
|
Actually, it seems like you have to give up your current code and start off with a new clean and simple one, which simply loops in a background worker do_work method and in each loop you:
1. open a file stream
2. copy the file through it //instead of using a dull command-line copy (sorry!)
3. close the stream //so you have your hd unlocked to decide the new free space
4. get the new free space and do the math
5. submit that value to the status member of the background process
6. load the value from step 5 to your progress bar control
Voala!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
i cannot loop any file writing: the command line process is imagex, that explode and apply a .wim image to the specified disk, it runs in a single instance, from start to end, and it takes approximately 20 minutes.
Hence, the process cannot be subdivided.
|
|
|
|
|
Say, this's different than I thought, hmmm, I'm not sure... did you try getting the file size instead?? I think it would lead into the same thing after all. If I were you, I'd simply use a dull loading like the one I'm using here
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
thanks mate,
i solved it instancing a separate thread.
|
|
|
|
|
LordZoster wrote: separate thread.
It's embarrassing I missed that!!
LordZoster wrote: thanks mate
No, thanks to you LordZoster!
This is usually the most beautiful kind of posts here in the cp: when you fight to find an answer but eventually find it yourself and be generous enough to share the answer with everyone..
Thanks again mate, and welcome to the code project we're proud to have such people in here
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
glad to be here, i'm learning alot from cp!
|
|
|
|
|
here is the EventHandler
public void ClickEventHandler(object sender, EventArgs e)
GetMethod by name
MethodInfo mi = type.GetMethod("ClickEventHandler");
and i need a EventHandler object for my other fucntion parameter
how could i convert this "mi" to a type of EventHandler
|
|
|
|
|
Do you really need to get the delegate from a string?
Just use the name ClickEventHandler as an identifier, and the compiler will identify it as an EventHandler delegate.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
When I upload any Text File through Fileupload control in Visual Studio 2005 in Asp.net 2.0 with C#.net 2.0. When I download or open the same file the actual content and the html content of the aspx page is displayed. How to get the actual content of the file when opening or saving the file.
|
|
|
|
|
I assume that you are using Resonse.WriteFile or Response.BinaryWrite to send the file in the response? Remove all markup from the aspx file except the @Page directive.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Why dont you post this question the ASP.Net forum?? You may get more answers.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
actually i m trying to make such an application which is distributed on different computers
over a network, i want that database should be on one computer ,all users can access it from there.
but different users have different rights .
for exmple : an organizaion having many departments like Accounts, Finance,HR,Sale,IT and so on.
now different users are available.
like HR manager doing some different task and Accounts manager doing differnt.
different departments are join together through networking .
how can i doing this?
Maifs
|
|
|
|
|
The answers you seek are covered by entire college courses and entire books. You will not get answers to these broad questions in a couple of forum posts.
I suggest picking up some books and do research on "Enterprise Software Development" and "N-Teir Development". "Patterns and Practices[^]" would also be a good place to start. There's thousands of pages of documentation and discussion on creating just such applications.
|
|
|
|
|
|
Hi Friends,
can u send Auto refresh web page code
madhu
|
|
|
|
|
madhu Rao wrote: Auto refresh
u can use the timer control for that.
Apurv
A man is but the product of his thoughts. What he thinks, he becomes.
.......Mahatma Gandhi
Be the change you want to see in the world.
.......Mahatma Gandhi
|
|
|
|
|
Simplest way to do it is
or (the version depends on what standard your page is employing)
|
|
|
|
|
Why dont you ask in the ASP.Net forum, you should get more answers.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Formatting inside Rich Text Box
Is there a way I can make certain sections of text formatted in a rich text box? Like parts of it are bold, underlined, different sizes or colors, all in the same Rich Text Box.
I'm making a program that will use an HTML view and a Standard view, and I have no way to format the standard view. So, in the HTML view, it would show "This is bold. This is Italic.", but in the standard view it would show "This is bold. This is Italic."
Help me??
|
|
|
|
|
Hi,
that is a basic but endless question. Formatting is what makes the RichTextBox different from a regular TextBox. Hence the answer is contained in the documentation on RichTectBox (read all of it), and in the many articles (CodeProject and other) on the subject. Google is your friend.
modified on Saturday, November 8, 2008 9:15 AM
|
|
|
|
|
You can make custom formatting by using RichTextBox.Select(int index, int lengthofselection) and after applying formatting to selection like RichTextBox.SelectionFont = "......", then calling RichTextBox.DeselectAll() and repeating the cycle. This still is kindda lame ... i would suggest looking at rtf's file format and make the formatting yourself or search for a class that does that.
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Microsoft.VisualBasic;
using System.Collections;
namespace Notepad1
{
public partial class formNotepad : Form
{
private string name;
public formNotepad()
{
InitializeComponent();
}
private void btnClear_Click(object sender, EventArgs e)
{
textBox1.Clear();
}
private void btncancel_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void sAVEToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
}
private void sAVEASToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
}
private void dELETEToolStripMenuItem1_Click(object sender, EventArgs e)
{
textBox1.Clear();
}
private void SELECTALLToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.SelectAll();
}
private void cLOSEToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void uNDOToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.Undo();
}
public void rEDOToolStripMenuItem_Click(object sender, EventArgs e)
{
// The redo code
}
private void NewtoolStripButton1_Click(object sender, EventArgs e)
{
if (!textBox1.Text.Equals(string.Empty))
{
if (MessageBox.Show("Do u want save the text Data", "Notepad", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
}
else
textBox1.ResetText();
}
}
private void opentoolStripButton2_Click(object sender, EventArgs e) //image
{
if (!textBox1.Text.Equals(string.Empty))
{
if (MessageBox.Show("Do u want save the text Data", "Notepad", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
else
textBox1.Clear();
}
else
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
name = openFileDialog1.FileName;
textBox1.Clear();
textBox1.Text = File.ReadAllText(name);
}
}
private void savetoolStripButton3_Click(object sender, EventArgs e) //image
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
}
private void deletetoolStripButton4_Click(object sender, EventArgs e) //image
{
textBox1.Clear();
}
private void webtoolStripButton5_Click(object sender, EventArgs e) //image
{
Interaction.Shell("C:\\Program Files\\Opera\\Opera.exe", AppWinStyle.NormalFocus, true, -1);
}
private void toolStripButton1_Click(object sender, EventArgs e) //image
{
textBox1.Copy();
}
private void toolStripButton2_Click(object sender, EventArgs e) //image
{
textBox1.Paste();
}
private void toolStripButton3_Click(object sender, EventArgs e) //image
{
textBox1.Cut();
}
private void fontStyleToolStripMenuItem_Click(object sender, EventArgs e)
{
if (fontDialog1.ShowDialog() == DialogResult.OK)
textBox1.Font = fontDialog1.Font;
}
private void colorToolStripMenuItem_Click(object sender, EventArgs e)
{
if (colorDialog1.ShowDialog() == DialogResult.OK)
textBox1.ForeColor = colorDialog1.Color;
}
private void formNotepad_Load(object sender, EventArgs e)
{
}
private void formNotepad_Resize(object sender, EventArgs e)
{
int frmwid = formNotepad.ActiveForm.Width;
int frmht = formNotepad.ActiveForm.Height;
textBox1.Width = frmwid-10;
textBox1.Height = frmht-90;
}
private void formNotepad_FormClosing(object sender, FormClosingEventArgs e)
{
if (!textBox1.Text.Equals(string.Empty))
{
if (MessageBox.Show("Do u want save the text Data", "Notepad", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
else
Application.Exit();
}
}
else
{
Application.Exit();
}
}
private void WordWrapToolStripMenuItem_Click(object sender, EventArgs e)
{
if (WordWrapToolStripMenuItem.Checked)
textBox1.WordWrap = true;
else
textBox1.WordWrap = false;
}
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
String str;
str = textBox1.Text;
if (e.KeyChar == 13)
if ((str.CompareTo(textBox1.Text)) == 0)
}
private void textBox2_MouseClick(object sender, MouseEventArgs e)
{
textBox2.Clear();
}
private void mENUToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void Find_TextChanged(object sender, EventArgs e)
{
// FIND code
}
}
}
Thanks friends
madhu
|
|
|
|
|
You forgot to ask a question...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|