2017-03-22 10 views
0

私はちょうど自分でC#を教えて、自分のアプリケーションを設計して仕事に必要なステップ量を減らすための趣味のプログラマーです。私はいくつかのことを助けたいと思います。インターネットフォームを更新するフィールドを作成したいのですが、これは2つの異なる言語間でさえ可能かどうかわかりません。フォームからフォームへのフィールドへのWebサイトへの入力

Website Elements

//When Button is Pressed Create The New Job In The Specified Location and 
//then create text files to send file attributes to. 
//Future: Add the ability to also use these field attributes to update and 
//create the job folder on the website as well. 

private void NewJob_Click(object sender, EventArgs e) 
    { 
     if (!Directory.Exists(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text)) 
      Directory.CreateDirectory(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text); 
     if (!Directory.Exists(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\0-Submittals")) 
      Directory.CreateDirectory(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\0-Submittals"); 
     if (!Directory.Exists(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\1-Pricing")) 
      Directory.CreateDirectory(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\1-Pricing"); 
     if (!Directory.Exists(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\2-Take Off")) 
      Directory.CreateDirectory(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\2-Take Off"); 
     if (!Directory.Exists(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\3-Files")) 
      Directory.CreateDirectory(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\3-Files"); 
     if (!Directory.Exists(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\4-Plans")) 
      Directory.CreateDirectory(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\4-Plans"); 
     if (!Directory.Exists(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\5-Specs")) 
      Directory.CreateDirectory(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\5-Specs"); 
     if (!Directory.Exists(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\6-Emails")) 
      Directory.CreateDirectory(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\6-Emails"); 
     if (!Directory.Exists(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\Properties")) 
      Directory.CreateDirectory(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\Properties"); 

     File.WriteAllText(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + @"\Properties\Contact.txt", lblContact.Text); 
     File.WriteAllText(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + @"\Properties\JobName.txt", lblJobName.Text); 
     File.WriteAllText(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + @"\Properties\BidDate.txt", lblBidDate.Text); 
     File.WriteAllText(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + @"\Properties\Engineer.txt", lblEngineer.Text); 
     File.WriteAllText(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + @"\Properties\TakeOff.txt", lblTakeOff.Text); 
     File.WriteAllText(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + @"\Properties\Received.txt", lblReceived.Text); 
     File.WriteAllText(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + @"\Properties\Vendor.txt", lblVendor.Text); 
     File.WriteAllText(@textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + @"\Properties\Notes.txt", lblNotes.Text); 

    } 

もう一つの問題は、あなたが右の防火壁を削除せずに、ファイルエクスプローラとして使用されているWebブラウザ上でクリックしたときにどのようにこのエラーを削除するにはあります。 Photo of the security Message

ありがとうございます。

答えて

0

は私が

ます。private void Generate_Click(オブジェクト送信者、EventArgsの電子) {

 if (lblContact.Text.Contains("name0")) 
      lblContact.Text.Replace("name0", "7"); 


     HtmlDocument doc = wbNewProject.Document; 
     HtmlElement wbJobName = doc.GetElementById("Name"); //lblcontact.text 
     HtmlElement wbEngineer = doc.GetElementById("engineer-lookup"); // 
     HtmlElement wbSalesEng = doc.GetElementById("SalesEngineerUserId"); 
     HtmlElement wbLocation = doc.GetElementById("Location"); 
     HtmlElement wbBidDate = doc.GetElementById("BidDate"); 
     HtmlElement wbPriorApproval = doc.GetElementById("PriorApproval"); //True or False 
     HtmlElement wbTakeOff = doc.GetElementById("TakeOffComplete"); //True or False 
     HtmlElement wbProject = doc.GetElementById("RoleType"); //Design/Build or Plan/Spec 
     wbJobName.SetAttribute("value", lblJobName.Text); 

     if (lblContact.Text.Contains("Name1")) 
      wbSalesEng.SetAttribute("value", "2"); 
     if (lblContact.Text.Contains("name2")) 
      wbSalesEng.SetAttribute("value", "3"); 
     if (lblContact.Text.Contains("name3")) 
      wbSalesEng.SetAttribute("value", "4"); 
     if (lblContact.Text.Contains("name4")) 
      wbSalesEng.SetAttribute("value", "5"); 
     if (lblContact.Text.Contains("name5")) 
      wbSalesEng.SetAttribute("value", "6"); 
     if (lblContact.Text.Contains("name6")) 
      wbSalesEng.SetAttribute("value", "7"); 
     if (lblContact.Text.Contains("name7")) 
      wbSalesEng.SetAttribute("value", "10"); 
     if (lblContact.Text.Contains("name8")) 
      wbSalesEng.SetAttribute("value", "11"); 
     if (lblContact.Text.Contains("name9")) 
      wbSalesEng.SetAttribute("value", "12"); 

     wbLocation.SetAttribute("value", lblLocation.Text); 
     wbBidDate.SetAttribute("value", lblBidDate.Text); 

     if (lblPriorApp.Text.Contains("Yes")) 
     wbPriorApproval.SetAttribute("value", "true"); 
     if (lblPriorApp.Text.Contains("No")) 
      wbPriorApproval.SetAttribute("value", "false"); 
     if (lblTakeOff.Text.Contains("Done")) 
     wbTakeOff.SetAttribute("value", "true"); 
     if (lblTakeOff.Text.Contains("Not Done")) 
      wbTakeOff.SetAttribute("value", "false"); 

     wbEngineer.SetAttribute("value", lblEngineer.Text); 
     wbProject.SetAttribute("value", lblProject.Text); 
    } 
アウトそれを考え出し
関連する問題