不错呦!smile@林凯西,确保“准备文件”中的几个文件都有安装,S...您好,看了您这篇帖子觉得很有帮助。但是有个问题想请...我的修改过了怎么还被恶意注册呢 @jjjjiiii 用PJ快9年了,主要是A...PJ3啊,貌似很少有人用PJ了,现在不是WP就是z...@332347365,我当时接入时错误码没有-10...楼主,ChkValue值应为-103是什么意思呢?...大哥 你最近能看到我发的信息,请跟我联系,我有个制...
RHEL5下用mono运行.NET控制台程序
编辑:dnawo 日期:2011-06-24
1.安装mono-2.10.2
安装时间有点漫长,接下来验证下是否安装成功:
这说明安装成功了。若是想卸载,运行make uninstall即可。
2.运行.NET控制台程序
Program.cs:
用mono运行程序:
可以了
参考资料
[1].编译安装mono 让linux也支持.NET应用:http://www.kaychen.cn/mono_install.html
复制内容到剪贴板 程序代码
[root@localhost soft]#wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.10.2.tar.bz2
[root@localhost soft]#tar -jxvf mono-2.10.2.tar.bz2
[root@localhost soft]#cd mono-2.10.2
[root@localhost mono-2.10.2]#./configure --prefix=/opt/mono
[root@localhost mono-2.10.2]#make&&make install
[root@localhost mono-2.10.2]#echo export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH>>~/.bash_profile
[root@localhost mono-2.10.2]#echo export PATH=/opt/mono/bin:$PATH>>~/.bash_profile
[root@localhost mono-2.10.2]#source ~/.bash_profile
[root@localhost soft]#tar -jxvf mono-2.10.2.tar.bz2
[root@localhost soft]#cd mono-2.10.2
[root@localhost mono-2.10.2]#./configure --prefix=/opt/mono
[root@localhost mono-2.10.2]#make&&make install
[root@localhost mono-2.10.2]#echo export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH>>~/.bash_profile
[root@localhost mono-2.10.2]#echo export PATH=/opt/mono/bin:$PATH>>~/.bash_profile
[root@localhost mono-2.10.2]#source ~/.bash_profile
安装时间有点漫长,接下来验证下是否安装成功:
复制内容到剪贴板 程序代码
[root@localhost mono-2.10.2]#mono -V
Mono JIT compiler version 2.10.2 (tarball 2011年 06月 24日 星期五 10:27:41 CST)
Copyright (C) 2002-2011 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)
Mono JIT compiler version 2.10.2 (tarball 2011年 06月 24日 星期五 10:27:41 CST)
Copyright (C) 2002-2011 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)
这说明安装成功了。若是想卸载,运行make uninstall即可。
2.运行.NET控制台程序
Program.cs:
复制内容到剪贴板 程序代码
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.Write("请输入一个路径:");
string path = Console.ReadLine();
string[] files = Directory.GetFiles(path);
foreach(string item in files)
Console.WriteLine(item);
Console.ReadKey();
}
}
}
using System.Collections;
using System.Collections.Generic;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.Write("请输入一个路径:");
string path = Console.ReadLine();
string[] files = Directory.GetFiles(path);
foreach(string item in files)
Console.WriteLine(item);
Console.ReadKey();
}
}
}
用mono运行程序:
复制内容到剪贴板 程序代码
[root@localhost soft]# wget ftp://192.168.0.111/file.exe
--12:01:59-- ftp://192.168.0.111/file.exe
=> `file.exe'
Connecting to 192.168.0.111:21... 已连接。
正在以 anonymous 登录 ... 登录成功!
==> SYST ... 完成。 ==> PWD ... 完成。
==> TYPE I ... 完成。 ==> 不需要 CWD。
==> SIZE file.exe ... 5120
==> PASV ... 完成。 ==> RETR file.exe ... 完成。
长度:5120 (5.0K)
100%[=======================================>] 5,120 --.-K/s in 0s
12:02:00 (111 MB/s) - `file.exe' saved [5120]
[root@localhost soft]# mono file.exe
请输入一个路径:/soft/
/soft/Firefox-3.6.17.tar.bz2
/soft/Firefox-latest.tar.bz2
/soft/console.exe
/soft/file.exe
/soft/flash-plugin-10.3.181.26-release.i386.rpm
/soft/install_flash_player_10_linux.tar.gz
/soft/linuxqq-v1.0.2-beta1.i386.rpm
/soft/linuxqq_v1.0.2_i386.tar.gz
/soft/mono-2.10.2.tar.bz2
/soft/winforms.exe
[root@localhost soft]#
--12:01:59-- ftp://192.168.0.111/file.exe
=> `file.exe'
Connecting to 192.168.0.111:21... 已连接。
正在以 anonymous 登录 ... 登录成功!
==> SYST ... 完成。 ==> PWD ... 完成。
==> TYPE I ... 完成。 ==> 不需要 CWD。
==> SIZE file.exe ... 5120
==> PASV ... 完成。 ==> RETR file.exe ... 完成。
长度:5120 (5.0K)
100%[=======================================>] 5,120 --.-K/s in 0s
12:02:00 (111 MB/s) - `file.exe' saved [5120]
[root@localhost soft]# mono file.exe
请输入一个路径:/soft/
/soft/Firefox-3.6.17.tar.bz2
/soft/Firefox-latest.tar.bz2
/soft/console.exe
/soft/file.exe
/soft/flash-plugin-10.3.181.26-release.i386.rpm
/soft/install_flash_player_10_linux.tar.gz
/soft/linuxqq-v1.0.2-beta1.i386.rpm
/soft/linuxqq_v1.0.2_i386.tar.gz
/soft/mono-2.10.2.tar.bz2
/soft/winforms.exe
[root@localhost soft]#
可以了
参考资料
[1].编译安装mono 让linux也支持.NET应用:http://www.kaychen.cn/mono_install.html
上一篇: Windows7使用putty通过SSH连接RHEL5
下一篇: Mono:System.ComponentModel.Win32Exception
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
最新日志:
下一篇: Mono:System.ComponentModel.Win32Exception
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
最新日志:
评论: 0 | 引用: 0 | 查看次数: 4938
发表评论
请登录后再发表评论!