C#如何调用F#的dll?......................................................C#如何调用F#的dll?

asiniliomlto 2009-10-16 01:46:20
C#如何调用F#的dll?
...全文
223 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
yilanwuyu123 2009-10-16
  • 打赏
  • 举报
回复
mark.. 没弄过,没发言权
dfgrethyrh 2009-10-16
  • 打赏
  • 举报
回复
[Quote=引用 15 楼 zengfanxing 的回复:]
C# codestring strContent="";//定义返回值string url="XXXXXXXXXXXXXX";//定义远程接口的字符串string postData= url+"&userName="+ username+"&passwd="+ password;// 穿成字符串
strContent= masterpage.shushengConent(postData);//调¡­
[/Quote]
你这http和f#有关系么?!
nosuchtracter 2009-10-16
  • 打赏
  • 举报
回复
F#一直闻其名不知其人
红街咖啡 2009-10-16
  • 打赏
  • 举报
回复

string strContent = ""; //定义返回值
string url = "XXXXXXXXXXXXXX"; //定义远程接口的字符串
string postData = url + "&userName=" + username + "&passwd=" + password; // 穿成字符串

strContent = masterpage.shushengConent(postData); //调用下面方法

public static string shushengConent(string Url)// 方法参数远程接口+参数
{
string strContent = ""; //返回值
HttpWebRequest httpRequest = null;
HttpWebResponse httpResponse = null;
StreamReader streamReader = null; try
{
httpRequest = (HttpWebRequest) WebRequest.Create(Url);
httpResponse = (HttpWebResponse) httpRequest.GetResponse(); //从对方接受返回值
streamReader = new StreamReader( httpResponse.GetResponseStream() );
strContent = streamReader.ReadToEnd();


}
Raul_Gonzalez 2009-10-16
  • 打赏
  • 举报
回复
Up!~Up!~
qshArcc 2009-10-16
  • 打赏
  • 举报
回复
整理一下
1 创建F#库项目
2 在Module1.fs文件中添加
let 加 a b = a + b
3 C#引用f#的dll
4 C#中调用
this.Text = Module1.加(2, 3).ToString();
dfgrethyrh 2009-10-16
  • 打赏
  • 举报
回复
F#是什么东西?
qshArcc 2009-10-16
  • 打赏
  • 举报
回复

Module1.fs文件来源
创建f#库时自动创建
qshArcc 2009-10-16
  • 打赏
  • 举报
回复

//Module1.fs文件
let 加 a b = a + b
qshArcc 2009-10-16
  • 打赏
  • 举报
回复

this.Text = Module1.加(2, 3).ToString();
//Module1里面调用你的函数。有点像当年的vb6。
cadtian 2009-10-16
  • 打赏
  • 举报
回复
接分
三界五行外 2009-10-16
  • 打赏
  • 举报
回复
如果都是基于.NET Framework的,可以直接调用
cdd1012 2009-10-16
  • 打赏
  • 举报
回复
人才啊!
tsp860901 2009-10-16
  • 打赏
  • 举报
回复
。。
  • 打赏
  • 举报
回复
……
softdq 2009-10-16
  • 打赏
  • 举报
回复
F#
qshArcc 2009-10-16
  • 打赏
  • 举报
回复
F#语法好诡异
eagerle01 2009-10-16
  • 打赏
  • 举报
回复
SF

13,347

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET技术前瞻
社区管理员
  • .NET技术前瞻社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧