|
there is a much simpler option. Simply add the reference, Microsoft.VisualBasic dll to your c# references project.
Within the Microsoft.VisualBasic dll is the VB.NET file copy routine which displays a copy progress dialog much like the windows one. Here is an example.
Microsoft.VisualBasic.FileIO.FileSystem.CopyFile("c:\helloworld.txt","c:\temp\helloworld.txt",UIOption.AllDialogs,UICancelOption.DoNothing);
|
|
|
|
|
Hi,
i tried ur way but cought in probs.
i gives me with error
"the type or namespace name 'FileIO' does not exists in the class or namespace 'microsoft.visualbasic' (are you missing ans assembly reference?)"
i have also included the reference in the project of microsoft.visualbasic
dont know wats the prob.
can u help?
Nitin...
|
|
|
|
|
Are you using visual studio 2005? As it works for me under that IDE. Apart from that I cant work out what could be your problem.
|
|
|
|
|
Hi,
thanx for reply.
no i m not using vs2005.
i am using vs2003.
can u help.
thanx
Nitin...
|
|
|
|
|
go buy a copy of visual studio 2005.
|
|
|
|
|
This sounds like a good option, except the progress bar I am using is in the status strip instead of a dialog box
|
|
|
|
|
I am using collections for the first time and can't seem to figure out how to obtain the index of the last entry in the collection.
I am guessing that I could use IndexOf() or LastIndexOf() methods, but not sure what to pass into the method.
Here is the code
public static class NumberProcessing<br />
{<br />
public static void UpdateSpinDataCollection()<br />
{<br />
SpinDataCollection.Add(new SpinData <br />
SpinNumber,<br />
CurrentNumber,<br />
Colour<br />
OddorEven);<br />
<br />
SDCPointer = (short)SpinDataCollection.LastIndexOf();<br />
<br />
MessageBox.Show("SDCPointer:\t" + SDCPointer.ToString());<br />
}<br />
}
Haz
|
|
|
|
|
What's the SpinDataCollection type? a Generic collection? An ArrayList?? What???
I'm on a Fuzzy State: Between 0 an 1
|
|
|
|
|
Sorry, it is a generic collection.
public static List<SpinData> SpinDataCollection = new List<SpinData>();
Haz
|
|
|
|
|
The pointy brackets containing the <spindata> bits have been removed from the code by the editor in my previous reply, not sure how to override that when posting here.
Haz
|
|
|
|
|
haz13 wrote: The pointy brackets containing the bits have been removed from the code by the editor in my previous reply, not sure how to override that when posting here.
Put the following characters together for a "less than" character: < When you post it, it will look like <
For "greater than" character, use the combination >, which will result in >
Alternately, you can check the "Ignore HTML tags in this message (good for code snippets)" checkbox when you go to post, which will ignore HTML symbols such as the "greater than" and "less than" characters.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: And in this corner, the Party of Allah
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
No, the editor doesn't remove them. Consider it as html. You can check the little check box to tell it to ignore html tags or you can replace your <'s with <'s and >'s with >'s.
Logifusion[^]
If not entertaining, write your Congressman.
|
|
|
|
|
|
Thank you all
Haz
|
|
|
|
|
I am developing a windows service with Visual Studio 2005 that automates the FTP of files to a remote server. I am wondering if anyone knows of a way I can programatically retrieve the available drive space on the remote server prior to the FTP transfer? I know that I can use the GetResponse method of the FTPWebResponse class to retrieve a status code indicating that there is insufficient space when that occurs, but I would prefer to be proactive.
Thank you...
|
|
|
|
|
As far as I know there is no way to know the free space unless the server has a [realy twisted custom] command fot it.
IE: If you want to store a file you send a "STOR" command. To change the current dir, the command is "CWD". As far as I know there is no "standard" command for get the free space
-- modified at 10:51 Friday 18th August, 2006
I'm on a Fuzzy State: Between 0 an 1
|
|
|
|
|
Ok. So I have a function (below) that edits the contents of a web page (loaded in the WEbBrowser control). It works fine when filling in the values of text fields, checking check boxes, and clicking buttons. But I need it to also be able to select an OPTION from a SELECT box.
Actual HTML from page I'm trying to edit...
====================================
<select name="MM" dir="ltr">
<option value="">month
<option value="1" >1
<option value="2" >2
<option value="3" >3
<option value="4" >4
<option value="5" >5
<option value="6" >6
<option value="7" >7
<option value="8" >8
<option value="9" >9
<option value="10" >10
<option value="11" >11
<option value="12" >12
</select>
====================================
The C# function...
====================================
/// <summary>
/// Edit the web Form contents of WebBrowser.
/// </summary>
/// <param name="fieldName">Name of control to edit in web form.</param>
/// <param name="fValue">Value to place in fieldName control.</param>
/// <param name="click">0=textbox, 1=button, 2=checkbox 3=combobox</param>
public void fillField(string fieldName, string fValue, int type)
{
HTMLDocument myDoc = null;
try
{
myDoc = new HTMLDocumentClass();
myDoc = (HTMLDocument)WebBrowser.Document;
HTMLInputElement x = (HTMLInputElement)myDoc.all.item(fieldName, 0);
if (type == 0)
x.value = fValue;
else if (type == 1)
x.click();
else if (type == 2)
x.@checked = true;
else if (type == 3)
{
// ??
}
}
catch
{
}
finally
{
myDoc = null;
}
}
====================================
Any help would be much appreciated!
Scott Clayton
|
|
|
|
|
I´ve got this error when I use threads I don´t know the reason. THe aplicationwork perfect, that is I get all the data from all the threads but I don´t know the meaning of the exeption and the possible consecuencies.
|
|
|
|
|
What exactly are you trying to do when this happens and is that all the message says? "WSACancelBlockingCall"? Or does it say something like: "A blocking operation was interrupted by a call to WSACancelBlockingCall"?
|
|
|
|
|
This is the answer that i´ve got. I´m working with threads.
|
|
|
|
|
Dear Friends
I migrated my project to .net 2005 which was in .net 2003(windows application using C# language)
When I run the solution the forms and the controls are as if it is still in .net2003
then I opened the files(all) and changed the versions from 1.0,1.3,etc to 2.0
till then I did not got the .net 2005 control appearance.
What should I do.
Please reply soon...
My mail Id is rabindrapatra@gmail.com
Thanks
Rabindra Patra
|
|
|
|
|
I guess you're looking for the Application.EnableVisualStyles method:
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new Form1());
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I used "Application.EnableVisualStyles();" and is working fine
Thanks for the quick reply.
Rabindra
|
|
|
|
|
How do you make a button the default button in a Windows form?
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Set it's DialogResult property to OK. To really do the job, set the 'AcceptButton' property of the form to that button as well.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|