|
N a v a n e e t h wrote: Looks like I have to implement FTPWebRequest class manually than using WebClient. Any other ideas ?
You dont have to.
Just use WebClient synchronously within a Thread of its own.
|
|
|
|
|
leppie wrote: Just use WebClient synchronously within a Thread of its own.
Thanks again leppie.
It won't report progress. I need to update my view (progress bar) too.
|
|
|
|
|
Could it be a limit on the FTP server? Maybe it blocks more than 2 requests from the same IP address (to ensure QOS)?
|
|
|
|
|
Thanks Senthil.
I am testing on local FTP and it allows around 1000 connection simultaneously. Any ideas ?
|
|
|
|
|
Hi
I work at a cancer department and we are using a planning system to plan the radiation therapy for the patients. Some of the data from the planning system can be exported, but it only exports it in Excel 4.0 Worksheet format. I am trying to write an application that can automate some processes. We do not have easy access to these Excel files and what I am trying to do is to have my C# application copy all the data on a worksheet in this Excel 4.0 file and paste it into a new Excel 2003 worksheet where we can manipulate the date.
I am using the following code to copy the data into the clipboard:
Excel.Application objApp = new Microsoft.Office.Interop.Excel.Application();
Excel.Workbook theWorkbook = objApp.Workbooks.Open(excelFile,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value);
Excel.Sheets sheets = theWorkbook.Worksheets;
Excel.Worksheet worksheet = (Excel.Worksheet)sheets.get_Item(1);
range = worksheet.get_Range(startCell, endCell);
range.Copy(Type.Missing);
When I run this and selects the Excel 4.0 file it comes up with the following error:
"External table is not in the expected format."
When I run the code and accesses Excel 2003, then it works fine. It seems to be a Excel version issue.
I am using Visual Studio 2005.
Does anyone know how I can access the data in Excel 4.0?
Thanks.
Kobus
|
|
|
|
|
You'll probably need older version of the Microsoft Office Dlls to access older versions of Excel, but you'll probably have a hard time finding them for Excel 4 seeing as it predates .Net by 10 years
|
|
|
|
|
how to call java script in c#.net application
Like this we call java script Function
Button1.Attributes.Add("onclick()", "return validate();");
modified on Friday, June 27, 2008 6:22 AM
|
|
|
|
|
I'm assuming you're talking about an asp.net program, in which case you're probably best asking over at the asp.net[^] forum.
(If you're not, I don't think it's possible to call a JavaScript from C#, JavaScript is an interpreted language and therefore requires a interpretor, which is usually part of a browser. You could use a web browser control and put the html/javascript in that I suppose. What is it you're trying to do?)
Simon
|
|
|
|
|
It is possible to run a javascript file from the command line using Windows Script Hosting (wsh).
|
|
|
|
|
Good thought.
Although why on earth would you want to...code reuse I suppose...
Simon
|
|
|
|
|
Simon Stevens wrote: code reuse I suppose...
|
|
|
|
|
Hello,
I have created installer for my project using setup project of VS2008 IDE.
Now, i want to send a updated dll so how can i create a patch which can replace the dll at given location?
Thanks in advance
|
|
|
|
|
|
Hehe, I think you replied to the wrong post
|
|
|
|
|
Oops... I did
Giorgi Dalakishvili
#region signature
my articles
#endregion
modified on Friday, June 27, 2008 10:11 AM
|
|
|
|
|
Just compile and make a new setup file only for the new dll. When the user setup new dll, by default existing dll will be remove.
|
|
|
|
|
can any body tell me that i have install my application.
My application is running while running i want to update configuration file can i do this
wasim khan
|
|
|
|
|
Well there's nothing stopping you from doing it. The file isn't locked or anything.
Weather your app picks up the changes is probably also up to you, you might have to have a FileSystemWatcher watch the file and reload settings if it changes.
Try it.
Simon
|
|
|
|
|
|
I am heaving thousands of rows in a Dataset, First i have to read the first row and have to start a process that sends the message to the rows values ,and then i have to wait for completing the task then the same work will go for the next row and so on..... Acctually what i want , I want to use threads though more then ont process could run at a time so i save my time,Please it is to urgent
I m doing like this .............
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Thread[] th;
private void button1_Click(object sender, EventArgs e)
{
th = new Thread[10];
for (int i = 0; i < 10; i++)
{
th[i] = new Thread(new ThreadStart(SendSMS1));
}
foreach (Thread t in th)
{
t.Start();
}
}
SqlConnection con;
SqlDataAdapter da;
DataSet ds;
DataSet dsAddRow;
private void Form1_Load(object sender, EventArgs e)
{
con = new SqlConnection(@"Data Source=NZN-7FC996E32D7\SQLEXPRESS;database=smscube;integrated security=true");
string str = "SELECT S.*,U.[name] AS 'UserName',Se.SenderID AS 'pCode','0' AS 'aCode',0 AS 'Type',U.password FROM SMSLog1 S LEFT OUTER JOIN UserLogin U ON S.UserID=U.UserID LEFT OUTER JOIN usersenderid Se ON Se.UserID=S.UserID";
da = new SqlDataAdapter(str, con);
ds = new DataSet();
dsAddRow = new DataSet();
i = 0;
da.Fill(ds);
}
static int i;
public void SendSMS1()
{
if (ds.Tables[0].Rows.Count <= i)
return;
string username =Convert.ToString( ds.Tables[0].Rows[i]["UserName"]);
string password =Convert.ToString( ds.Tables[0].Rows[i]["Password"]);
string type =Convert.ToString( ds.Tables[0].Rows[i]["TYPE"]);
string pcode =Convert.ToString( ds.Tables[0].Rows[i]["pCode"]);
string acode =Convert.ToString( ds.Tables[0].Rows[i]["aCode"]);
string mobilenumber =Convert.ToString( ds.Tables[0].Rows[i]["MobileNo"]);
string message = Convert.ToString(ds.Tables[0].Rows[i]["Text"]);
Process curPro= Process.Start("http://203.145.131.149:81/login/pushurl.php?USERNAME=" + username + "&PASSWORD=" + password + "&TYPE=" + type + "&pcode=" + pcode + "&acode=" + acode + "&mnumber=" + mobilenumber + "&message=" + message);
curPro.WaitForExit();
i++;
}
}
|
|
|
|
|
ali zaidi wrote: Please it is to urgent
This[^] is worth reading
I am not getting what you are trying to do. If 10 threads call SendSMS1 method, you will get 10 browser windows open. Your code is not thread safe too. Explain your problem clearly to get help.
|
|
|
|
|
I m heaving URL that is used to send sms to a user that is in the url.
I have to read the username from the dataset and have to add this username into the url. now i have to open the webbrowser to hit the sms and now i have to wait for two or three seconds to uoto sms goes after it i need to open the web browser for the new user and have to send sms.
I do not know Threading but if i do not use threading the speed is to slow i want send sms at lest to atlest ten users at a time though i could save my time
|
|
|
|
|
ali zaidi wrote: now i have to open the webbrowser to hit the sms and now i have to wait for two or three seconds to uoto sms goes after it i need to open the web browser for the new user and have to send sms.
This is not a good way to do. Don't they provide some kind of web services to send SMS ? In your method, for 1000 rows, you will have 1000 browser windows opened. Joseph Albahari has written a great article on threading here[^]. It's worth reading. CP also has some great article on threading, try to search for it.
|
|
|
|
|
Yesterday I didn't get any reply so maybe today someone can help me:
hi guys, I am almost desperate about this, I was trying for whole day yesterday, I want to set the initial directory for OpenFileDialog on FTP folder. How I can do that please help me. If someone knows some example it will be great to share with me. Thx Ahead
|
|
|
|
|
Try this
mOpenFileDialog.InitialDirectory = string.Format("ftp://{1}:{2}@{0}", server, userName, password);
mOpenFileDialog.ShowDialog(this);
Be careful using the username password because if they are wrong the dialog will ask the user for a username password in a pop up
|
|
|
|