当前位置:网站首页>Const string inside function - C #

Const string inside function - C #

2022-07-04 07:50:00 45MA

Mricrosoft XNA Excerpts from the education catalogue :

    /// <summary>    /// Draws the control, using SpriteBatch and SpriteFont.    /// </summary>    protected override void Draw()    {        const string message = "Hello, World!\n" +                               "\n" +                               "I'm an XNA Framework GraphicsDevice,\n" +                               "running inside a WinForms application.\n" +                               "\n" +                               "This text is drawn using SpriteBatch,\n" +                               "with a SpriteFont that was loaded\n" +                               "through the ContentManager.\n" +                               "\n" +                               "The pane to my right contains a\n" +                               "spinning 3D triangle.";        GraphicsDevice.Clear(Color.CornflowerBlue);        spriteBatch.Begin();        spriteBatch.DrawString(font, message, new Vector2(23, 23), Color.White);        spriteBatch.End();    }

The lottery is called per second 60 Time . Whether there is performance overhead in allocating messages in the lottery ? Is it the same as moving it to a static helper class ? as far as I am concerned , The cost expression is composed of C# Compiler evaluated . Here const What happens to modifiers ?

Reference plan

const Only evaluated once . Move it to a static variable , There will be nothing .

This json Is the format correct ? - c#

When I try to parse json data , Return the wrong syntax error , Please help me find grammar mistakes .[{"isData":"Yes","Details":"[{"Id":"70","Name":"Test","FileName&#…

.NET C#Webbrowser Fill in the input , No ID Or the name of the class - javascript

I need to fill in an input in the web browser , But it doesn't work . I think we must use name Properties to complete , But how to do it ?foreach (HtmlElement login in webBrowser1.Document.GetElementsByTagName("input")) { if (login.GetAttribute("name"…

ddl Not updated in the server -asp.net - javascript

I am here ASP.NET c# To work on . I have one DropDownList. (runat =“ server”) stay $ {document).ready On , I updated its value :$(document).ready(function () { document.getElementById("ddl").value = "abc"; ……

When the reply is sometimes an object and sometimes an array , How to analyze when using transformation JSON reply ? - java

I am using Retrofit To get JSON reply . This is part of my implementation [email protected]("/api/report/list") Observable<Bills> listBill(@Query("employee_id") String employeeID); The bill category is -public static class…

asp.net mvc The object array data in is always null - javascript

I need to go through json Send an array of objects to asp.net mvc 2, But I am mvc Not found in the controller null The object is entries[1].date = "12/22/2014" entries[1].Ref = "0002" entries[1].Credit = "100" entries[2].da…

原网站

版权声明
本文为[45MA]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202141517542830.html