Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A method and device for duplicating functions in c-sharp

A technology for copying methods and functions, applied in the direction of software testing/debugging, etc., can solve problems such as destroying the encapsulation of the original function

Active Publication Date: 2021-02-02
WUHAN DOUYU NETWORK TECH CO LTD
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

When calling the original function directly without changing the original function, the conventional method can be used; when the original function needs to be changed, such as changing the variables in the original function, the previous use of the original function will be changed, and the original The previous function modification of the function failed, which destroyed the encapsulation of the original function

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method and device for duplicating functions in c-sharp
  • A method and device for duplicating functions in c-sharp
  • A method and device for duplicating functions in c-sharp

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0043] The specific implementation manners of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0044] In one embodiment of the present invention, a method for copying functions in C-sharp is provided, figure 1 The overall flowchart of the function copy method in C-sharp provided by the embodiment of the present invention, the method includes: S1, obtaining the assembly of the C-sharp program, if the assembly is the assembly of the target function, then according to the The assembly obtains the metadata of the target function; S2, uses the metadata of the target function to create a copy function; S3, gets the function body of the target function, and sets the function body to the created copy function middle.

[0045] Specifically, in S1, C-sharp, also known as C#...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present invention provides a method and device for duplicating functions in C-sharp, the method comprising: S1, obtaining the program set of the C-sharp program, if the program set is the program set where the target function is located, then according to the program set Obtain metadata of the objective function; S2, use the metadata of the objective function to create a copy function; S3, acquire a function body of the objective function, and set the function body into the created copy function. In one aspect of the present invention, the copied target function does not affect the original code of the target function when it is called by other codes; on the other hand, the copied function described in this embodiment can be directly called next time after it is created.

Description

technical field [0001] The invention relates to the field of software testing, and more specifically, to a method and device for copying functions in C-sharp. Background technique [0002] In the .net framework, it may be necessary to create a copy function at runtime, such as copying the target function for the probe program to call without affecting other programs. The probe detects the website directory, CPU usage, server operating system and component support based on the copied target program. [0003] At present, the conventional practice is to directly call the original function, but it can only be used in some cases. When calling the original function directly without changing the original function, the conventional method can be used; when the original function needs to be changed, such as changing the variables in the original function, the previous use of the original function will be changed, and the original The previous function modification of the function f...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F11/36
Inventor 刘吉林张文明陈少杰
Owner WUHAN DOUYU NETWORK TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products