将代码从pastebin.com加载到tryfsharp.org

时间:2013-06-28 11:39:01

标签: f# pastebin

页面嵌入了一个pastebin代码段。我需要一种方法来打开tryfsharp.org,只需单击页面上的链接即可加载此代码片段。如果使用以下格式“http://www.tryfsharp.org/Create?codeUrl= {sourceurl}”使用网址,则可以在fssnip.net上托管代码段。当我在其中插入pastebin url作为参数时,则加载了完全错误的字符集,包括非字母字符。 例如,此处http://pastebin.com/raw.php?i=hprEq4A8是代码“let a = 1”,当我打开此网址http://www.tryfsharp.org/Create?codeUrl=http://pastebin.com/raw.php?i=hprEq4A8时,它应显示代码“let a = 1”,而不是显示完全错误的内容。有人设法做到这一点吗?

1 个答案:

答案 0 :(得分:1)

使用F# Snippets代替Pastebin :-)。如果你在那里发布一个F#片段,它会添加颜色和工具提示(就像你在Visual Studio中看到的那些),你也可以加载片段来尝试F#。

例如,this sample snippet有一个“tryfsharp.org”链接,可以使用以下网址引导您Try F# and loads the snippethttp://www.tryfsharp.org/Create?codeUrl=http://fssnip.net/raw/iF

如果你想使用Pastebin,那么Pastebin需要在根目录中有clientaccesspolicy.xml文件(这告诉Silverlight允许访问该域)。您可以查看the file on fssnip.net因此,这不是Try F#的功能请求,而是Pastebin。