3
Answers

C# create folder structure and place files within folders created

Photo of dc

dc

12y
8.3k
1
I would like to accomplish the following tasks in a C#.net 2010 application:

1. start in a specified directory location.
2. check to see if a specified subfolder exists.
3. if the specified folder does not exist, create the subfolder called customer1.
4. if the subfolder  called 'docs' does not exist, create that folder.
5. if the type of document type is '*.pdf' or '*.doc' place the data file in the subfolder called
    'docs'.
    if the document type is of any other document type, place that document in folder level where called 'customer1'.

Thus I am wondering if you can tell me and/or point me to references that will show me how to accomplish all and/or parts of the steps I would like to accomplish listed above my showing me showing me code and/or pointing me to links that will show me how to accomplish this goal?

Answers (3)

0
Photo of Ranjit Powar
NA 8.1k 496.8k 9y
try jquery as below
 
$('#TextBox2').focus(function(){
    $('#TextBox2').val($('#TextBox1').val());
}); 
 
 
 
 
 
If it helps you select it as correct answer. 
Accepted
0
Photo of parul jain
NA 140 10.4k 9y
Sir how we will define loop in following statement :
 
 
$('#gvDetails_txtPackaging_0').blur(function () {
if ($('#gvDetails_txtPackaging_0').val() > $('#gvDetails_txtQuantity_0').val()) {
alert('Packaging number can not be greater than Quantity of product')
}
});
 
0
Photo of Ranjit Powar
NA 8.1k 496.8k 9y
If your problem solved, then select it as correct answer. So other users with same problem no which is correct answer.
0
Photo of parul jain
NA 140 10.4k 9y
thank you so much sir.. :) :)
its working... 
0
Photo of Ranjit Powar
NA 8.1k 496.8k 9y
$('#TextBox2').blur(function(){
if($('#TextBox2').val()>$('#TextBox2').val()
{
//Give error message here 
}
});
0
Photo of parul jain
NA 140 10.4k 9y
yeah sir exactly..
0
Photo of Ranjit Powar
NA 8.1k 496.8k 9y
You mean to say when you enter value in textboxt2 right??
0
Photo of parul jain
NA 140 10.4k 9y
yes sir i can..
actually i want restriction that if we are enter some value in textbox1 so in textbox2 must have the value that will be less than or equal to the value of textbox1... 
0
Photo of Ranjit Powar
NA 8.1k 496.8k 9y
can you explain. It gives same value in textbox2
0
Photo of parul jain
NA 140 10.4k 9y
thank you ranjit sir its working..
but in textbox 2 i want the value which is less than or equal to textbox 1..plz give solution becoz i am new in jquery 
0
Photo of Shubham Kumar
NA 6.5k 260.7k 9y
hi try this:
 
 
<asp:TextBox runat="server" id="textbox1" onblur="SetTextInTextBox2()" />
<asp:TextBox runat="server" id="textbox2" onfocus="SetTextInTextBox2()" />

in javascript


  1. function SetTextInTextBox2()   
  2. {   
  3. var a=document.getElementById('textbox1').value ;  
  4. var b= document.getElementById('textbox2').value  
  5. if(a>0)     
  6. {  
  7.  document.getElementById('textbox2').value = document.getElementById('textbox1').value;   
  8. }  
  9.