Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ C # assembly calls across constants, variables and functions     - New features of Java 9 HTTP2 and REPL (Programming)

- Analyzing Linux server architecture is 32-bit / 64-bit (Server)

- Safe learning through self-extracting package to achieve invasion (Linux)

- After CentOS configure SSH password Free, still prompted for a password (Linux)

- Valgrind * not * leak check tool (Linux)

- Linux, Oracle listen address modification (Database)

- Nonstandard IMP-00010 error processing one case (Database)

- The practical application of Oracle synonyms + dblink (Database)

- How to clear the v $ archived_log view expiration information (Database)

- How to override the plain text files and directories soft connection in linux (Linux)

- Linux GCC 5.1.0 compiler installation (Linux)

- Android custom ViewPager create kaleidoscopic image transition effects (Programming)

- CentOS5 installation Nodejs (Linux)

- BGP routers want to play it by CentOS (Linux)

- Java-- get the reflection object information (Programming)

- 25 Git Advanced Skills (Linux)

- Docker in the development and practice of IFTTT (Server)

- Copy and paste in Linux terminal and Vim (Linux)

- Linux system commands to view hardware information (Linux)

- Docker improve safety (Server)

 
         
  C # assembly calls across constants, variables and functions
     
  Add Date : 2017-05-10      
         
         
         
  Today try to explain the concept of C # assemblies when suddenly asked to live. It is also a function seriously under C # assemblies, this article is about C # assembly calls across other assemblies constants, variables, and functions.

Step 1: Create two assemblies, namely "Windows Forms Application" and "library" C # under, were named "AAAAA" and "BBBBB". Assembly "BBBBB" The class was renamed MyClass

Step 2: Modify the assembly "BBBBB", file MyClass.cs code as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace BBBBB
{
    public class MyClass
    {
        /// < Summary>
        Constants ///
        /// < / Summary>
        public const string DateInfo1 = "2015/1/5";
        
        /// < Summary>
        /// Static variables
        /// < / Summary>
        public static string DateInfo2 = "2015/1/5";
 
        /// < Summary>
        /// Method ( "print Hello World!")
        /// < / Summary>
        public static void SayHi ()
        {
            Console.WriteLine ( "Hello World!");
        }
    }
}

There is a constant DateInfo1, a static variable DateInfo2, print a string to the console "Hello World!" Approach

Step 3: Add the assembly reference "BBBBB" in the assembly "AAAAA" reference manager. Assembly "AAAAA" reference manager in Solution Explorer, right-click Assembly "AAAAA" below "Reference", click "Add Reference" button to enter. Enter the assembly "AAAAA" reference manager after the tree menu on the left, find the "Solution" -> "Project", check the inside of the "BBBBB", and press the "OK" button to save the settings.

Step 4: Download this assembly "AAAAA" in the following code can be set using the program "BBBBB" a namespace

Program.cs file in the code as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
using BBBBB;
 
namespace AAAAA
{
    class Program
    {
        static void Main (string [] args)
        {
            // Print constants
            Console.WriteLine (BBBBB.MyClass.DateInfo1);
 
            // Print the static variable
            Console.WriteLine (BBBBB.MyClass.DateInfo2);
            
            // Call the method
            BBBBB.MyClass.SayHi ();
 
            Console.ReadLine ();
        }
    }
}

Step 5: Build Solution, run the program, the results

Other: two documents constitute Debug directory

1) Assembly "AAAAA" in the Debug directory :( include all the information assembly "BBBBB" compiled out)

2) Debug directory assembly "BBBBB" under

END
     
         
         
         
  More:      
 
- Learning the Linux powerful network management capabilities (Linux)
- Linux, Google Test (GTest) test environment to build step (Linux)
- df show disk space usage (Linux)
- Three details reflect the Unix system security (Linux)
- File compression and packaging commands under Linux (Linux)
- Java Concurrency - processes and threads (Programming)
- Linux process management related content (Linux)
- HDFS Hadoop Distributed File System Works (Server)
- Oracle GoldenGate tutorial Second, configure and use (Database)
- Linux Desktop allows exceptionally different launch applications (Linux)
- Ubuntu derivative version of the user and how to install SmartGit / HG 6.0.0 (Linux)
- Linux reserves the rest of the file to delete several (Linux)
- Nonstandard IMP-00010 error processing one case (Database)
- SME Linux network security policy server security (Linux)
- CentOS use wget (Linux)
- Linux ACL permissions (Linux)
- DataGuard the MRP can not start to analyze and solve problems (Database)
- iOS custom keyboard emoji expression (Programming)
- VMWare virtual machine without rebooting way to add virtual disk (Linux)
- Ubuntu 14.04 and derivative versions of the user install Pantheon Photos 0.1 (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.