Assembly reference for filedownloader? - c#

What is the assembly reference for a Filedownloader in c#?
I am looking for to download the files from ftp to my local drive 'c' ,
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
FileDownloader f = new FileDownloader();
which reference should I need to add for the filedownloader?

I guess that you are trying to download files from FTP,and you don't have to use the FileDownloader class.
You can use this link for example: "http://msdn.microsoft.com/en-us/library/ms229711(v=vs.110).aspx".
You can also use an open source to do that, try looking at this link: "http://www.codeproject.com/Tips/443588/Simple-Csharp-FTP-Class"
There is an example of how simple it is to use (From the link above):
ftp ftpClient = new ftp(#"ftp://10.10.10.10/", "user", "password");
ftpClient.download("etc/test.txt", #"C:\Users\metastruct\Desktop\test.txt");

Related

Compile time Error for Passing value from a TextBox to RDLC report

I want to pass a textbox value to RDLC report. For said purpose my code is:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Reporting.WebForms;
using System.IO;
using System.Data.SqlClient;
using System.Configuration;
using System.Globalization;
ReportParameterCollection reportParameters = new ReportParameterCollection();
reportParameters.Add(new ReportParameter("ReportParameter1", t1.Text));
this.reportViewer2.LocalReport.SetParameters(reportParameters);
this.reportViewer2.RefreshReport();
But i get the error during compile time which is:
Error 15 The best overloaded method match for 'Microsoft.Reporting.WinForms.Report.SetParameters(System.Collections.Generic.IEnumerable<Microsoft.Reporting.WinForms.ReportParameter>)' has some invalid arguments
Error 16 Argument 1: cannot convert from 'Microsoft.Reporting.WebForms.ReportParameterCollection' to 'System.Collections.Generic.IEnumerable<Microsoft.Reporting.WinForms.ReportParameter>'
This error occurs on following line:
this.reportViewer2.LocalReport.SetParameters(reportParameters);
Help is required to resolve it. Thanks in advance
I resolved the error by replacing Microsoft.Reporting.WebForms with Microsoft.Reporting.WinForms

SelectFrame - switchTo().frame WEBDRIVER

Using webdriver (in C# not java) I want to selectframe, but this line is not working to me:
driver.switchTo().frame("ifr");
which Hierarchy I must write about selectframe? I never use selectFrame in a proyect
I have this only:
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
If you want to perform some action (click a button) which is inside an iFrame, you need to switch to it (move focus / "zoom-in") because by default you are on the top parent.
Example: In order to get the text from the colored iFrame from here http://www.w3schools.com/html/tryit.asp?filename=tryhtml_iframe_height_width first you need to do
<'WebDriver'>.switchTo().frame(<'frameId'>)
and after that you will be able to get the text.

Cannot find the namespace for generic type "List"

I have a strange error and don't know how to solve that. I have a Form which gets opened by another (Main)Form. When I write
List<String> valStoreAsString = new List<String>();
I get "The value or namespace List could not get found". My using directives are the following:
using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Collections;
using System.Runtime.InteropServices;
In the other Forms it works fine. What happened here?
Add following using directive to the list of usings.
using System.Collections.Generic;
Tip
If you are using Visual Studio and if you don't know the namespace then type name of type (Case sensetive) in editor and then press ctrl+ . and select add using option and VS will add related using for you.
or you can right click on name of Type and select Resolve option and select using .... sub option.

How to Use Ado.net Model in Helper Class in asp.net c#

I have a folder
Helper
1. Class (SessionManagement.cs)
I have Model.edmx at root.
How can I use Model in my SessionManagement Class
I want it like this
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NGO_MS.Model; // Error is The type or name space Model does not exist
using NGO_MS.Controls;
using System.Net.Mail;
using System.Net;
using System.Web.UI;
using NSLogger;
using NGO_MS.DAL;
using System.Configuration;
My question is how can i use it with using ? I am beginer Kindly guide me.
Inside a method in your SessionManangement class paste the following code.
using (Model ctx = new Model()){
}

I can't see RenderMode-property in ToolStripSeparator c#

I have a problem with RenderMode-property of the ToolStripSeparator.
When I put the following line of code :
this.toolStripSeparator1.RenderMode = ToolStripRenderMode.System;
I have the following error :
error 44 'System.Windows.Forms.ToolStripSeparator' does not contain a
definition for 'RenderMode' and no extension method 'RenderMode'
accepting a first argument of type
'System.Windows.Forms.ToolStripSeparator' could be found (are you
missing a using directive or an assembly reference?)
Despite, I put the references
using System.Windows.Forms;
Below is a list of my references
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 System.Threading;
using System.Diagnostics;
Do you have any ideas what could cause this error?
ToolStripRenderMode Enumeration's value can be assigned to RenderMode property of ToolStrip.
ToolStripSeparator donot have any such property.
I think you should use it like this:
toolStrip1.RenderMode=ToolStripRenderMode.System;

Categories

Resources