C
Chocolade1972
Guest
TreeNode newNodeText = null;
TreeNode newNodeParsed = null;
TreeNode rootNode = treeViewMS1.Nodes[0];
TreeNode nextNode = rootNode;
if (!txtDir.Text.Contains("/"))
{
newNodeText = new TreeNode(txtDir.Text);
if (!rootNode.Nodes.Contains(newNodeText))
{
rootNode.Nodes.Add(newNodeText);
}
string f = Path.GetFileName(txtUploadFile.Text);
newtNodeText.Nodes.Add(f);
}
It keep enter This line:
if (!rootNode.Nodes.Contains(newNodeText))
And when im running my program i see the newNodeText in the treeView1 root.
What i need to do is this checkings:
1. To check if the newNodeText already exist in the root if not add it.
2. To check if inside/under newNodeText the variable f exist or not. If not to add it.
Now what its doing its adding each time to the root new newNodeText and inside the file.
For example:
root
test
test.jpg
If the node test already exist dont add a new one to the root and check if in test the file test.jpg exist.
If test not exist add it to the root and add the file.
In general to check that it will not add the newNodeText and f more then once.
Continue reading...
TreeNode newNodeParsed = null;
TreeNode rootNode = treeViewMS1.Nodes[0];
TreeNode nextNode = rootNode;
if (!txtDir.Text.Contains("/"))
{
newNodeText = new TreeNode(txtDir.Text);
if (!rootNode.Nodes.Contains(newNodeText))
{
rootNode.Nodes.Add(newNodeText);
}
string f = Path.GetFileName(txtUploadFile.Text);
newtNodeText.Nodes.Add(f);
}
It keep enter This line:
if (!rootNode.Nodes.Contains(newNodeText))
And when im running my program i see the newNodeText in the treeView1 root.
What i need to do is this checkings:
1. To check if the newNodeText already exist in the root if not add it.
2. To check if inside/under newNodeText the variable f exist or not. If not to add it.
Now what its doing its adding each time to the root new newNodeText and inside the file.
For example:
root
test
test.jpg
If the node test already exist dont add a new one to the root and check if in test the file test.jpg exist.
If test not exist add it to the root and add the file.
In general to check that it will not add the newNodeText and f more then once.
Continue reading...