|
I want to download all files from a certain FTP folder to a folder on local machine. I am using C#.NET. Is there anyone to give me any idea how to do that? If someone have code to do that, plz upload it.
Thanks
|
|
|
|
|
|
the link contains a demo which uses the FTPWebRequest class. I want to build a console application not a web application. Can anyone else tell me how to implement this functionality in a window console application usin C#
|
|
|
|
|
This is just an example that shows you how to use FtpWebRequest class. This class does not require the use of a Web application.
-----
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
|
|
|
|
|
|
Hi all,
I'm starting my app (.NET1.1), celebrating good practice, with an info form, which contains nothing but a picturebox and a timer which closes the window after 3 sec. not more. 1000 times it works without problems but sometimes I get the following exception. How do I have to handle such exception ? I have no idea ?
System.TypeInitializationException: Der Typeninitialisierer für System.Drawing.SafeNativeMethods hat eine Ausnahme verursacht. ---> System.Threading.ThreadAbortException: Der Thread wurde abgebrochen.
at System.Drawing.SafeNativeMethods.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)
at System.Drawing.SafeNativeMethods.Initialize()
at System.Drawing.SafeNativeMethods..cctor()
--- Ende der internen Ausnahmestapelüberwachung ---
at System.Drawing.SafeNativeMethods.CreateIconFromResourceEx(Byte* pbIconBits, Int32 cbIconBits, Boolean fIcon, Int32 dwVersion, Int32 csDesired, Int32 cyDesired, Int32 flags)
at System.Drawing.Icon.Initialize(Int32 width, Int32 height)
at System.Drawing.Icon..ctor(SerializationInfo info, StreamingContext context)
at System.Drawing.SafeNativeMethods.CreateIconFromResourceEx(Byte* pbIconBits, Int32 cbIconBits, Boolean fIcon, Int32 dwVersion, Int32 csDesired, Int32 cyDesired, Int32 flags)
at System.Drawing.Icon.Initialize(Int32 width, Int32 height)
at System.Drawing.Icon..ctor(SerializationInfo info, StreamingContext context)
IntPtr CreateIconFromResourceEx(Byte*, Int32, Boolean, Int32, Int32, Int32, Int32)
Thank's for help
Frank
fracalifa
|
|
|
|
|
Insufficient data, you might want to show the code.
Wild guess: you did use a timer other than Forms.Timer, and its handler
is performing an Illegal Cross-Thread operation on a control (probably the InfoForm itself).
If correct, the remedy is either use Forms.Timer or read up on Control.Invoke
|
|
|
|
|
Here is the code ... nothing spectacular
public class Info_Start : System.Windows.Forms.Form
{
private System.Windows.Forms.Timer timer1;
private System.ComponentModel.IContainer components;
public Info_Start()
{
InitializeComponent();
timer1.Interval = 5000;
timer1.Start();
this.TopMost=true;
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Info_Start));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(512, 360);
this.ControlBox = false;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(520, 368);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(520, 368);
this.Name = "Info_Start";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.TopMost = true;
this.Click += new System.EventHandler(this.Info_Start_Click);
this.Activated += new System.EventHandler(this.Info_Start_Activated);
}
#endregion
private void timer1_Tick(object sender, System.EventArgs e)
{
this.Close();
}
private void Info_Start_Click(object sender, System.EventArgs e)
{
this.Close();
}
}
}
that's all ...
|
|
|
|
|
fracalifa wrote: nothing spectacular
I agree.
Looks fine at first glance.
Now my guess is, when it fails, it is the timer firing before the form has been completely
loaded (i.e. in the middle of loading the icon, see StackTraceBack).
Remedy might be: wire a Load event and use it to start your timer.
|
|
|
|
|
Hi Luc,
thank you.
I'll try this.
Let's see what happens after the 999th start ....
Frank
|
|
|
|
|
Hi Frank,
you could make a test setup that creates a new form which selfdestroyes after some time,
put everything in a loop, and make the delay a random number say in the range 100...5000
msec (use a static Random !!) then let this run and watch how long it lives on average
(say 3 minutes).
Now apply my (or other) suggestions to fix, and let the same test run say ten times as
long (hence 30 minutes); if that succeeds, you know you have dramatically improved things.
The whole process would take no more than 1 hour, and need little or no human intervention.
Beats launching it manually 1000 times, and not feeling sure whatsoever... (This is
assuming you manage to make the loop fail sooner or later to begin with).
|
|
|
|
|
Hi Luc,
good idea.
My feeling is that this could be a runtime problem (loading the relating lib's on the first start).
Later the lib's are in the file cache and the problem does not occur.
In parallel I will test your suggestion.
Thank's
Frank
|
|
|
|
|
Hai Everybody,
I want to create an application in which i have to have a single CPU but the results has to be displayed in multiple monitors which are all connected to it. Can any one help me by specifying the requirements.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
M. J. Jaya Chitra wrote: Can any one help me by specifying the requirements.
Software, hardware, human resourses?
|
|
|
|
|
Software and hardware resources (For hardware i have posted the same in the hardware discussion board).
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Well on the software side you just need an OS that supports multiple monitors. Which is pretty much all OS's these days. From .Net you can use the 'System.Windows.Forms.Screen' class to deal with what monitors are available and where they are.
For the hardware you just need as many GFX ports as you have monitors. Unless your doing heavy graphics stuff your bog standard graphics card should handle it all. A multicore CPU would probably be handy just to make sure all the windows stay nice and responsive but not a requirement.
|
|
|
|
|
Hello all
at my job i made a Stocks program.
in this stock program there is Reports that show some info from the database.
the report viewer works on windows xp , but on windows 98 im getting this error
An error occurred during local report processing
"The definition of the report 'Main Report' is invalid.
server has encontered a confiuration error.see the report server log files for more information"
Please Help me .
|
|
|
|
|
What is this built with? VC++? C#? VB? What is Main Report? A component you built? A third party control?
michael@cohen wrote: "The definition of the report 'Main Report' is invalid.
server has encontered a confiuration error.see the report server log files for more information"
Well, what do the log files say?
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
the code is c# ,i dont know what is main report...
and i dont know where can i find the log file...
|
|
|
|
|
Hi,
Im writing an auto update app in vs2005. I would like
to call an update procedure from a web service automatically
at say 19:00 everyday.
What would be the best way of achieving this?
I dont need any code or anything just wanna know the best easiest or safest way
of doing this and then start googling :P
Thanks
|
|
|
|
|
Hi
I have problem here
i have a column DateTime in database
i want to insert time only in this column
but after i add the time i find the data in table is date with time
this conflict the data when i rowfilter the dataview by this column
how can i solve it
"comment: this is the code of DataView "
DV_Deatils.RowFilter = "Room_No='" + combo_Rooms.SelectedValue + "' and ExamDate='" + dtp_examdate.Value.ToString("D") + "'"+
" and ExamTime>='" + txt_time.Text + "' and ExamTimeTo<='"+txt_timeto.Text+"'";
MD_NADA
|
|
|
|
|
md_nada wrote: but after i add the time i find the data in table is date with time
This is because the fact that SQL doesnt has a datatype called time but DateTime.
What you can do is, in the design mode of your database table set the format as short time( or which ever suitable to you)
|
|
|
|
|
Manas Bhardwaj wrote: What you can do is, in the design mode of your database table set the format as short time( or which ever suitable to you)
The database isn't interested in the format of the DateTime. Setting some format only alters the way it is displayed. It will still store something for the date portion.
This means you still have to consider what date you are going to give it so that queries work as expected.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Assuming this is MS Sql Server, there is no Time datatype, only DateTime. You just need to ignore the Date portion of the DateTime field you're interested in.
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
Simply ignore the date part when you retrieve the value from the database.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|