This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (variables == null) | |
| { | |
| variables = new Dictionary<string, object>(); | |
| } | |
| if(variables.ContainsKey(name)) | |
| { | |
| variables[name] = value; | |
| } | |
| else | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <AML> | |
| <Item type='Part' action='add'> | |
| <item_number>P0011</item_number> | |
| <title>My Part1</title> | |
| <name>P0011</name> | |
| <major_rev>B</major_rev> | |
| <description>Welcome new part1</description> | |
| </Item> | |
| </AML> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.UI; | |
| using System.Web.UI.WebControls; | |
| namespace Test.linq | |
| { | |
| public partial class WebForm1 : System.Web.UI.Page |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| To Get escapded values | |
| public string EscapeXMLValue(string value) | |
| { | |
| if (string.IsNullOrEmpty(s)) return s; | |
| string temp = s; | |
| temp = temp.Replace("'","'").Replace( "\"", """).Replace(">",">").Replace( "<","<").Replace( "&","&"); | |
| return temp ; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| XmlTextReader objreader = new XmlTextReader("c:\\a.xml"); | |
| StringBuilder strBuilXML = new StringBuilder(); | |
| while (objreader.Read()) | |
| { | |
| if (objreader.IsStartElement()) | |
| { | |
| if (objreader.IsEmptyElement) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cls | |
| $startTime = Get-Date | |
| Write-Host "Start " + $startTime.ToString("u") | |
| $exePath = "C:\My.exe" | |
| & $exePath | |
| $endTime = Get-Date | |
| Write-Host "End " + $endTime.ToString("u") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Set exePath="C:\My.exe" | |
| Echo "Call PS1" | |
| PowerShell.exe Set-ExecutionPolicy RemoteSigned; "C:\MyScript.PS1" -exePath %exePath% | |
| Echo "End PS1" | |
| PAUSE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Param | |
| ( | |
| [string]$exePath = $null | |
| ) | |
| write-host “Calling exe” | |
| $startTime = Get-Date | |
| Write-Host "Start time " + $startTime.ToString("u") | |
| $exePath = $exePath | |
| & $exePath |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| StringBuilder strBuilLog = new StringBuilder(); | |
| string strLogData = "Welcome to log data \t"; | |
| strBuilLog.Append(strLogData); | |
| string strLogData2 = "Welcome to log data 2" + Environment.NewLine; | |
| strBuilLog.Append(strLogData2); | |
| string strLogDataFinal = "Welcome to log data final \t"; | |
| strBuilLog.Append(strLogDataFinal); | |
| using (StreamWriter strwLog = new StreamWriter("c:\\log.txt")) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Root> | |
| <Address myatt="abc">NY</Address> | |
| <Address>AUS</Address> | |
| </Root> | |
| if (myXelement.Element("Address").Attribute("myatt").Value == "Abc") | |
| { | |
| myXelement.Element("Address").Attribute("myatt").Value = "XYZ"; | |
| } |