C# Static types cannot be used as parameters

前端 未结 8 2614
被撕碎了的回忆
被撕碎了的回忆 2021-02-18 13:22
public static void SendEmail(String from, String To, String Subject, String HTML, String AttachmentPath = null, String AttachmentName = null, MediaTypeNames AttachmentTy         


        
8条回答
  •  礼貌的吻别
    2021-02-18 13:30

    A workaround to passing static parameters is to pass it as an object.

    Function:

    public static void HoldKey(object key)
    {
       ...
    }
    

    Call function:

    Function(static param);
    

提交回复
热议问题