Difference between revisions of ".NET"
From Blue-IT.org Wiki
(→Shellscripts) |
(→Monodevelop) |
||
(10 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
As long as Microsoft products are tight to C# in this way it is wise to use this programming language in a pragmatic manner. | As long as Microsoft products are tight to C# in this way it is wise to use this programming language in a pragmatic manner. | ||
− | C# sharp has a lot of interesting features. | + | |
+ | C# sharp has a lot of interesting features. And the code base is open! | ||
+ | |||
+ | == Monodevelop == | ||
+ | === Xamarin official site === | ||
+ | This is the official site. There are links how to get this with | ||
+ | * http://www.mono-project.com/docs/getting-started/install/linux/ | ||
+ | |||
+ | If you ever have problems with older packages, simply remove them: | ||
+ | |||
+ | apt-get remove libmono-* | ||
+ | apt-get install monodevelop | ||
+ | |||
+ | === PPAs === | ||
+ | |||
+ | If you ever have problems with older packages, simply remove them: | ||
+ | |||
+ | apt-get remove libmono-* | ||
+ | |||
+ | * https://launchpad.net/ubuntu/+ppas?name_filter=monodevelop | ||
+ | |||
+ | --[[User:Apos|Apos]] ([[User talk:Apos|talk]]) 22:58, 10 July 2014 (CEST) | ||
+ | The inizan-yannick-ppa in this list seems to be one of the stable ones (to be tested) | ||
+ | |||
+ | sudo apt-add-repository ppa:inizan-yannick/mono | ||
+ | sudo apt-get update | ||
+ | sudo apt-get install monodevelop mono | ||
+ | |||
+ | apt-get remove libmono-* | ||
+ | apt-get install monodevelop | ||
== NetOffice == | == NetOffice == | ||
Line 21: | Line 50: | ||
NetOffice eliminates these disadvantages and remains a 1:1 wrapper that is syntactically and semantically identical to the interop assemblies. | NetOffice eliminates these disadvantages and remains a 1:1 wrapper that is syntactically and semantically identical to the interop assemblies. | ||
+ | </blockquote> | ||
== CSharp == | == CSharp == | ||
− | === Shellscripts === | + | === CSharp compiler mono === |
+ | |||
+ | * http://www.mono-project.com/CSharp_Compiler | ||
+ | |||
+ | === Shellscripts in Mono === | ||
+ | |||
+ | * http://www.csscript.net/help/CS-Script_on_Mono.html | ||
+ | |||
+ | === Shellscripts in Windows === | ||
Compiling an application | Compiling an application | ||
Line 31: | Line 69: | ||
Simple application example | Simple application example | ||
− | |||
using System; | using System; | ||
using System.Diagnostics; | using System.Diagnostics; | ||
Line 38: | Line 75: | ||
public class Script | public class Script | ||
{ | { | ||
− | + | /// Add a shared network drive mapping | |
− | + | /// </summary> | |
− | + | /// <param name="uri">The drive letter (e.g. L:)</param> | |
− | + | /// <param name="unc">The UNC path to the remote drive (e.g. \\MyServer\MyPrinter)</param> | |
− | + | /// <param name="opt">Mount options (e.g. /persistent:yes /credsave)</param> | |
− | + | static void MapNetworkDrive(string uri, string unc, string opt) | |
− | + | { | |
− | + | ProcessStartInfo pInfo = new ProcessStartInfo("net", "use " + uri + " " + unc + " " + opt); | |
− | + | pInfo.CreateNoWindow = false; | |
− | + | pInfo.UseShellExecute = true; | |
− | + | pInfo.WindowStyle = ProcessWindowStyle.Hidden; | |
− | + | Process RunIt = Process.Start(pInfo); | |
− | + | RunIt.WaitForExit(5000); //give it some time to finish | |
− | + | RunIt.Close(); | |
− | + | ||
− | + | } | |
− | + | ||
− | + | static void Main() | |
− | + | { | |
− | + | MapNetworkDrive("Z:", "\\servername\share", "/savecred"); | |
− | + | } | |
− | + | ||
} | } | ||
− | + | [[Category:dotNET]] | |
− | |||
− | |||
− | [[Category: | ||
[[Category:CSharp]] | [[Category:CSharp]] | ||
[[Category:Office 2010]] | [[Category:Office 2010]] |
Latest revision as of 10:43, 8 March 2015
Contents
Programming MS Office in C# - Why?
There are a lot of complaints on not developing open source software on csharp (Stallman - Don't depend on mono). There might be or might be not an software patent issue with C# in future.
Unfortunately it is obvious, that a lot of software has to be developed for Microsoft Office out there. As a programmer addicted to document management, I can't ignore that. So I was looking around searching to get my work done without beeing bundled with Visual Studio ...
As long as Microsoft products are tight to C# in this way it is wise to use this programming language in a pragmatic manner.
C# sharp has a lot of interesting features. And the code base is open!
Monodevelop
Xamarin official site
This is the official site. There are links how to get this with
If you ever have problems with older packages, simply remove them:
apt-get remove libmono-* apt-get install monodevelop
PPAs
If you ever have problems with older packages, simply remove them:
apt-get remove libmono-*
--Apos (talk) 22:58, 10 July 2014 (CEST) The inizan-yannick-ppa in this list seems to be one of the stable ones (to be tested)
sudo apt-add-repository ppa:inizan-yannick/mono sudo apt-get update sudo apt-get install monodevelop mono
apt-get remove libmono-* apt-get install monodevelop
NetOffice
The Manufactor describes the advantages of developing for MS Office with its product in the following way:
Why NetOffice?The usual methods for accessing Microsoft Office. NET are the Primary Interop Assemblies and VSTO. Both access methods involve various disadvantages.
They are limited to a version, i.e. they only work with one or certain versions of Office They cause problems while transferring or installation on other systems They offer no protection mechanism in the management of COM proxies
NetOffice eliminates these disadvantages and remains a 1:1 wrapper that is syntactically and semantically identical to the interop assemblies.
CSharp
CSharp compiler mono
Shellscripts in Mono
Shellscripts in Windows
Compiling an application
c:\Windows\Microsoft.NET\Framework\v3.5\csc.ext /t:exe /out:my.exe my.cs
Simple application example
using System; using System.Diagnostics; using System.ComponentModel; public class Script { /// Add a shared network drive mapping /// </summary> /// <param name="uri">The drive letter (e.g. L:)</param> /// <param name="unc">The UNC path to the remote drive (e.g. \\MyServer\MyPrinter)</param> /// <param name="opt">Mount options (e.g. /persistent:yes /credsave)</param> static void MapNetworkDrive(string uri, string unc, string opt) { ProcessStartInfo pInfo = new ProcessStartInfo("net", "use " + uri + " " + unc + " " + opt); pInfo.CreateNoWindow = false; pInfo.UseShellExecute = true; pInfo.WindowStyle = ProcessWindowStyle.Hidden; Process RunIt = Process.Start(pInfo); RunIt.WaitForExit(5000); //give it some time to finish RunIt.Close(); } static void Main() { MapNetworkDrive("Z:", "\\servername\share", "/savecred"); } }