|
Thank you. Could you tell me how I display the results to the web, instead of using Console.write? Is there another class output specific for a web app?
Regards
|
|
|
|
|
The best vehicle for displaying this in a web is using a treeview control.
public void MyForm_Load(object sender, EventArgs e)
{
InitializeComponent();
RecursiveGetDir(@"C:\Windows", myTreeView.Nodes);
Console.Read();
}
static void RecursiveGetDir(string cDir, TreeNodesCollection nodes)
{
DirectoryInfo[] dirs = new DirectoryInfo(cDir).GetDirectories();
if (dirs.Length > 0)
{
foreach(DirectoryInfo dir in dirs)
{
TreeNode node = new TreeNode(dir.FullName);
nodes.Add(node);
RecursiveGetDir(dir.FullName, node.Nodes);
}
}
}
|
|
|
|
|
i am calling a web service method in my windows application
the method returns xml file,i would like to set the Connection
timeout for my web service to 20 minutes,
and the counter is reset to zero everytime you Access any of the functions on the web service
So if you access the web service again within 20 minutes you dont need to log on again,
can any of you refer me to articles or samples
thanks
regards paula
|
|
|
|
|
Hi Paula,
20 minutes sounds like a very long timeout for a webservice. Even stranger is that you want it to reset it when accessing other methods. Why would you want to do this? Are you trying to fake events?
One way to go might be (in .NET 2.0) to use the asynchronous methods of the webservice proxy. You can then easily cancel your original call and re-issue it when you call any other method, but this is not good if it really does take say 15 minutes to return the data you asked for, as you'll keep aborting it and restarting.
Regards,
Rob Philpott.
|
|
|
|
|
hi
I m getting this error, while i close the form the window closes but the threads donot stop, The Dispose is executing fine.
My code goes like this....
private void button1_Click(object sender, EventArgs e)
{
Thread th = Thread(fn1);
th.Start();
}
public void fn1()
{ while (true)
{ lock (this)
{
//Do Something
}
Thread.Sleep(1000);
}
}
Thanks in advance
|
|
|
|
|
Hello
For sure you application will keep running.
Either:
1- Make you Thread.IsBackground = true
2- Or Terminate your thread in the Form_Closing event.
Regards
|
|
|
|
|
dear frndz,
i need the equivalent of
intFileNameLength = Instr(1, StrReverse(strFileNamePath), "\\")
instr???
strreverse??
mid??
All I ever wanted is what others have....
CrazySanker
|
|
|
|
|
Hello
If you tell us what you want to do in english, it would be a lot easier.
Regards
|
|
|
|
|
It's plain obvious what he wants to do.
Regards,
Rob Philpott.
|
|
|
|
|
AFAIK there is no equivalent for StrReverse but you can use String.LastIndexOf method to get the index of the last occurence of a substring.
Or for the given problem use Path.GetFileName(strFileNamePath).Length .
"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
|
|
|
|
|
crazysanker wrote: instr???
for the equivalent of instr look at IndexOf or LastIndexOf.
crazysanker wrote: strreverse??
You'll have to write that yourself, since there is no percieved commercial need for this.
for ( int i = str.Length-1; i>=0; i-- )
{
rStr += str[i];
}
return rStr;
crazysanker wrote: mid??
That is just str.Substr(startPos, len); if I remember my Visual Basic correctly.
|
|
|
|
|
thank u for nice reply
All I ever wanted is what others have....
CrazySanker
|
|
|
|
|
Hi I am having trouble trying to display some rows of a html table. I am trying to display the same amount of rows that is in a datatable returned from database. At the moment I have named all rows of table and put in the runat=”server” so I can reference it in the code. This is the code I am using but I get an invalid cast error
//*** work through datatable of drills
for(int rowNum = 1; rowNum<=iSet.Tables[0].Rows.Count; rowNum++)
{
//*** declare founctrl and set equal to a control found with the id
TableRow founctrl = (TableRow)FindControl("row"+rowNum.ToString());
//*** if a control is found
if (founctrl != null)
{
//*** dislay the row
founctrl.Visible = true;
}
}
I am looping throught datatable and tryin to find the rows of html table and make them visible but it crashes on the line that tries to find the tablerow. So im just wondering if there is a better way to go about this or am I making a mistake in this code thanks in advance. Tim
|
|
|
|
|
Hi Tim,
I don't know that much about DataTables and the like, but the way you are extracting the row from the table looks highly dubious to me.
Why not do something like:
foreach(TableRow row in iSet.Tables[0].Rows)
{
row.Visisble = true;
}
.. whether that would have the desired effect of making the row visible or not I'm not sure.
Regards,
Rob Philpott.
|
|
|
|
|
Hi Rob,
i think u picked me up wrong there i have 2 dif table one is filled from the db (and is just in memory) with a max of 12 rows and there is also a html table (on asp.net page) which has 12 rows but if i only get 4 rows from the db then i need to display only 4 of these html table rows and so on
|
|
|
|
|
Hi,
I have a complied .chm help file that works fine when run from anywhere on my computer or on another computer when installed as part of the program it relates to.
When I make the chm file available for download and I download it from the website I get the usual warning from the system that it may be unsafe etc. I click on run but then it can't find the actual html files to display.
How do I get around this without creating a whole new .msi file?
Glen Harvy
|
|
|
|
|
Hello
I you want to make your chm file optional, you could make it downloadable, and put it in an installer that would look for the path of your already installed application to put it in the same folder. ie.
1- Make you app.
2- Make the installer of your app put the [TARGETDIRECTORY] path in a registry key
3- Make you app look for the chm file in its folder, if not available it should display a polite message that the help file isn't available and you can download it from here.
4- Make another installer -ie. msi- that contains the help file only, and would automatically install it in the program's folder using that registry key.
I hope I got you right.
Regards
|
|
|
|
|
Thanks for your suggestion BUT it's not really what I want.
I don't want to install anything.
I just want a person to be able to download the .chm file, click on it and they can read it.
Glen Harvy
|
|
|
|
|
So, you downloaded the chm file to your machine -using save as, not run-, and when you opened it you saw it empty?
Regards
|
|
|
|
|
Saving to the desktop OR runing it - either way you get the same problem.
I have since found out why - it's a security issue with the OS. MS in their wisdom decided that the user also has to "unblock" the pages manually http://support.microsoft.com/kb/896054.
It seems I will have to make the .chm file an msi file otherwise I will have to have a help file on how to read the help file!
Is it possible to create a help file at complie time that doesn't use html files.
Cheers.
Glen Harvy
|
|
|
|
|
Glen Harvy wrote: Is it possible to create a help file at complie time that doesn't use html files.
Sometimes I did my help file as an embeded flash in one of my forms. No I make it as audio help with ToolTips poping up all over the screen telling the users where to go. You can also use videos.
Regards
|
|
|
|
|
fellows!
i want a popup menu when a right click a treenode of my treeview control. i do find mousedoubleclick and mousclick event but couldn't find right mouse click.
May God help u solv ur problems as well,thx in advance!!
|
|
|
|
|
You need to subsribe to MouseUp event.
For Example
private void treeView_MouseUp(object sender, MouseEventArgs e)
{
TreeViewHitTestInfo htInfo = treeView.HitTest(e.X, e.Y);
MessageBox.Show(htInfo.Node.Text);
}
|
|
|
|
|
private void treeView1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
MessageBox.Show("Right mouse button clicked...do something about it");
} or
private void treeView1_<code>NodeMouseClick</code>(object sender, <code>TreeNodeMouseClickEventArgs </code>e)
{
if (e.Button == MouseButtons.Right)
MessageBox.Show("Right mouse button clicked on a node...do something about it");
}
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Here is how I have done it:
private void treeView1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
treeView1.SelectedNode = treeView1.GetNodeAt (e.X ,e.Y );
}
}
|
|
|
|