function:

   public static dynamic GetAppSecret()
{
//string[] result = new string[] { "", "" };
dynamic result = new System.Dynamic.ExpandoObject(); result = new { appid="appid", appSecret = "appSecret" }; return result;
}

if you want to use the dynamic result function in a difference assembly, you should add following code to assemblyInfo.cs

[assembly: InternalsVisibleTo("WeChatSchools")]

invoke:

var secret = Helper.GetAppSecret();
app.t_appid = secret.appid;
app.t_appkey = secret.appSecret;

C# return dynamic/anonymous type value as function result的更多相关文章

  1. java.lang.IllegalArgumentException: No converter found for return value of type: class com.smart.result.Page

    今天学习了一下spring boot 中的mybatis,用mybatis来增删改查用户,获取用户,添加用户,修改用户,删除用户,修改用户,都是可以的,但是获取带分页的用户列表,一直抛出这个java. ...

  2. C++:Abstract class : invalid abstract return type for member function ‘virtual...’

    #include <iostream> #include <cmath> #include <sstream> using namespace std; class ...

  3. 无法将类型“System.Collections.Generic.List<anonymous type:string ClassID,string ClsssName>”隐式转换为“System.Collections.Generic.List<Ecology.Model.EnergyFlowGraph>”

    无法将类型“System.Collections.Generic.List<anonymous type:string ClassID,string ClsssName>”隐式转换为“Sy ...

  4. How to get the return value of the setTimeout inner function in js All In One

    How to get the return value of the setTimeout inner function in js All In One 在 js 中如何获取 setTimeout ...

  5. 解决springmvc报No converter found for return value of type: class java.util.ArrayList问题

    一.背景 最近闲来无事,想自己搭建一套Spring+SpringMVC+Mybatis+Mysql的环境(搭建步骤会在以后博客中给出),结果运行程序时,适用@ResponseBody注解进行返回Lis ...

  6. 解决java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.ArrayList这个问题

    今天使用SSM框架,用@ResponseBody注解,出现了这个问题 java.lang.IllegalArgumentException: No converter found for return ...

  7. Error 1313: RETURN is only allowed in a FUNCTION SQL Statement

    1.错误描述 14:07:26 Apply changes to rand_string Error 1313: RETURN is only allowed in a FUNCTION SQL St ...

  8. 解决No converter found for return value of type: class java.util.ArrayList

    十一月 02, 2018 7:37:44 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() f ...

  9. Idea中:No converter found for return value of type: class java.util.ArrayList:Json格式转换问题

    1.在搞SSM框架的时候,前端发送请求后,显示如下错误. @ResponseBody注解进行返回List<对象>的json数据时出现 nested exception is java.la ...

随机推荐

  1. Map的遍历方式

    public class Mapper { public static void main(String[] args) {  Map<String, String> map = new ...

  2. NIO学习:异步IO实例

    工作模式: 客户端代码: package demos.nio.socketChannel; import java.io.ByteArrayOutputStream; import java.io.I ...

  3. kindle paperwhite2 root 密码修改方法

    昨天由于kindle的耗电量突然增大,开始查找原因.经过检查搜索后,确定是由于卡索引的问题导致,于是开始解决这个问题.然而在通过ssh以root身份登陆到kindle上时,始终出现登陆错误,提示密码不 ...

  4. java.util.Stack类简介

    Stack是一个后进先出(last in first out,LIFO)的堆栈,在Vector类的基础上扩展5个方法而来 Deque(双端队列)比起Stack具有更好的完整性和一致性,应该被优先使用 ...

  5. HTML文本格式化

    文本格式化标签: 标签 描述 <b> 定义粗体文本. <big> 定义大号字. <em> 定义着重文字. <i> 定义斜体字. <small> ...

  6. 在jsp中的css

    div#one{}div#two{ width:auto; height:20px;background-color:#FAEBD7;text-align:right;}div#three{ widt ...

  7. android开发者博客二月Android Studio2.0测试

    参考网页-http://android-developers.blogspot.com/2016/02/android-studio-20-beta.html Android Studio 2.0-B ...

  8. ACM/ICPC ZOJ1006-Do the Untwist 解题代码

    #include <iostream> #include <string> #include <stdlib.h> using namespace std; int ...

  9. exists改写SQL,使其走正确的执行计划

    数据库环境:SQL SERVER 2005 今天看到一条SQL,写得不是很复杂,返回7000多条数据,却执行了15s.SQL文本及各表的数据量如下: SELECT acinv_07.id_item , ...

  10. 访问 HTML中元素的方法

    http://www.w3school.com.cn/jsref/index.asp   1.document.getElementbyId("id1"),Html中,名称是id1 ...