Version 1 of tclcsharp

Updated 2004-12-15 08:12:30

What: tclcsharp

 Where: http://sourceforge.net/projects/tclcsharp
 Description: Tcl/CSharp is an implementation of a Tcl interpreter written entirely in C#. 
   Tcl/CSharp was ported from Jacl (Tcl Java implementation) in version 1.3.1
   It offer a bridge to .NET Framework for Tcl code.
 Updated: 12/2004

Contact: Artur Trzewik

---

Some code examples that shows where tclcsharp can be valueable:

 # example how to use .NET Framework for accessing web

  package require java
  java::load -gac System.dll
  set webclient [java::new System.Net.WebClient]
  # it can be used alos for https
  set bytearr [$webclient DownloadData http://www.google.de]
  puts [[java::call System.Text.Encoding get_UTF8] GetString $bytearr]

 # example how to use .NET Framework for doing XML per DOM

  package require java
  java::load -gac System.Xml.dll
  set doc [java::new System.Xml.XmlDocument]
  set node [$doc CreateElement tclsharp]
  $doc AppendChild $node
  $node AppendChild [$doc CreateTextNode "is usable for many things"]
  puts [[$doc get_DocumentElement] get_OuterXml]

 # accessing operation system

  package require java
  java::load -gac System.dll
  set procs [java::call System.Diagnostics.Process GetProcesses]
  for {set x 0} {$x<[$procs length]} {incr x} {
     set proc [$procs get $x]
     puts [format "%4s %15s %2s %20s" [java::prop $proc Id] \
          [java::prop $proc ProcessName] [java::prop $proc BasePriority] \

[java::prop $proc MainWindowTitle]

  }