Archiv der Kategorie: .NET

Direktes Kompilieren von C#-Sourcecode (von .cs-Dateien zu .dll-Dateien)

Voraussetzung: .NET installiert

using System;

public class Talker
{
    public void SaySomething()
    {
        Console.WriteLine("Programmieren Sie immer so, als wäre der Typ, der den Code pflegen muss, ein gewaltbereiter Psychopath, der weiß, wo Sie wohnen. - Finde mehr davon: http://www.thewebhatesme.com/allgemein/zitate-aus-der-informatik/#sthash.hzQ8WVML.dpuf.");
    }
}

Speichere den Code als Talker.cs auf C:\Users\michael

Öffne nun cmd und kompiliere das Ganze mit csc.exe (https://msdn.microsoft.com/de-de/library/ms379563%28v=vs.80%29.aspx):

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /t:library /out:Talker.dll "C:\Users\michael\Talker.cs"

Das hat in C:\Users\michael die Talker.dll erzeugt, die man nun benutzen kann.

Use .NET libraries in Robot Framework

With Robot Framework on IronPython (Install Robot Framework with IronPython on Windows) you still implement the keywords in Python, but you can seamlessly access the wealth of .NET-libraries.
An example is worth a thousand words; so find an example how to use System.IO.File from .NET to create a file:
1.) IronPython (Python on .NET) file:

import System
class FileManager:
    def create_file(self, fileName):
        System.IO.File.Create(fileName)

… save as C:\Program Files (x86)\robotframework-2.9\src\bin\FileManager.py
2.) Robot Framework file:

*** Settings ***
Library    FileManager
*** Test Cases ***
My Test
    Create File    fantastic.txt

… save as C:\Program Files (x86)\robotframework-2.9\src\bin\ExampleTestCase.txt
The Keyword „Create File“ in this .txt is automaically matched to the create_file method from the Python file. The underscore is automatically „translated“ to a space.
3.) Execute in cmd:

cd C:\Program Files (x86)\robotframework-2.9\src\bin
ipybot ExampleTestCase.txt

Finished! Find fantactic.txt in C:\Program Files (x86)\robotframework-2.9\src\bin.
For more information on Robot Framework read: https://it-kosmopolit.de/strategic-link-collection-of-robot-framework/

IIS (Internet Information Services) installieren

Den IIS (Internet Information Services) auf Windows 7 zu installieren ist ein Kinderspiel, da diese „Funktion“ schon „vorinstalliert“ ist und nur noch aktiviert werden muss:

1.) Drücke die Windows-Taste, gib „Windows-Funktionen“ ein und bestätige:

Installation IIS Internet Information Services 1

Das kann ein bischen dauern … Dann in das Kästchen vor „Internetinformationsdienste“ klicken:

Installation IIS Internet Information Services 2

Das war’s. Als Erfolgskontrolle nur noch „localhost“ in die Adresszeile eines Browser eingeben, et voila:

Installation IIS Internet Information Services 3