During report statistics today, I found some information on the Internet, sorted it out, and shared it.
1. Use the folderbrowserdialog class in C # To select a folder and record the selected folder path.
(1) first introduce the namespace system. Windows. forms;
(2). Add the [stathread] attribute to the main entry point of the application, that is, the static void main () method;
///
(3). then define the event trigger;
Private void button1_click (O
components in vs2005
Create a COM component compiled by C #. The project type is class library.
Configuration: Right-click addcom in Solution Explorer, select "properties", select "generate", and select "register for com InterOP (_ p )"
Open the assemblyinfo. CS file and set [Assembly: comvisible (true)]
This allows you to generate the addcom. TLB file.
Figure 2 com generation settings
Program
Personal Project Practice, feasible
Asp.net C # export Excel
/// /// Al: columnname of the record set to be printed: Display name of the header/// Public static void outtoexcel (arraylist Al, string [] columnname ){
Microsoft. Office. InterOP. Excel. Application Excel = new Microsoft. Office. InterOP. Excel. Application ();Microsoft. Office.
C # Use Word to print the code. The specific implementation code is as follows:
Datetime dt = datetime. now;Object none = system. reflection. Missing. value;Microsoft. Office. InterOP. Word. Application wordapp = new Microsoft. Office. InterOP. Word. Application ();Microsoft. Office. InterOP. Word. Document document =
. Net Program excel export method can be described everywhere. however, it is only the export of some data. versions, formats, and locations are generally not considered. and word export. this may not be frequently used. word operations are indeed a little harder than excel operations. here, the younger brother collected some information. I wrote a demo. it seems suitable for use in the development process. the core code below will be shared with you.
The project first references a component Mic
Studio generates an InterOP assembly for the project that might not work fully in all cases. for more information, see troubleshooting in office at run time.
Note
Some assemblies are added to a project automatically when an assembly that references them is added. for example, references to the assemblies office. DLL and Microsoft. VBE. interOP. DLL are added automatically when you add a reference to the Wo
. garbage collection), a set of extensions are-required to standard C ++. In. NET 1.x the extended language is called Managed Extensions for C + +. In. NET 2.0 ME C + + has been completely redesigned under the stewardship of Stan Lippman, and renamed C++/CLI.
----Forget C +
Recently, in a project, the customer requested to display the content in the generated RTF file by page. As he had no idea about this, he also found relevant information on the Internet, in addition, I used my own search on MSDN to solve the problem. The following is a simple summary of C # Word documents (encryption, decryption, and pagination). I hope to help some friends. Pai_^
Before writing code, you need to reference the corresponding DLL file:
operation may cause exceptions and exchange temporary copies with the original object;
3. The Terminator, dispose () method, and the target method bound to the delegate object should ensure that they do not throw an exception under any circumstances. 46. Minimal interoperability
1. There are three costs for interoperability: Data enumeration costs between managed and unmanaged stacks, and switching costs between managed and unmanaged code, development work for developers dealing with hybrid
The GNU program, also known as the slave program, was publicly launched by Richard Stallman on September 27, 1983. Its goal is to create a set of completely free operating Systems. It has made a standard for the GNU C when writing Linux. ANSI American national standards association, the standard ANSI C standard that it made to C was later accepted by the Internat
1. Introduction
C ++ language was originally created as "a better C ", however, this does not mean that the compilation and connection methods used by global variables and functions similar to C in C ++ are the same as those in C. As a language to be compatible with
This article is about how to invoke C (c + +)-written DLLs in a C # environment.
"Reprint marked the source."
First, the preferred creation of a C DLL project, production DLL files used for standby, steps are as follows:
1, VS2010 create C + + Project Select Win32 Applicatio
In recent projects, project source code confidentiality issues are involved, because the code is written in C #, easy to decompile, so the decision to extract the core algorithm part of the use of C + + writing, C + + so far seems to have not been very good decompile, of course, if you are a disassembly master, perhaps it is possible to decompile. This means that
Turn from: http://www.cppblog.com/franksunny/archive/2007/11/29/37510.html
First, C + + is called:
Declare the C + + function as ' extern ' C ' (make this declaration in your C + + code) and call it (called in your C or C + + code
), convert. toint32 (textbox2.text). tostring ();
Actually, this pinvoke function is used by the worker.
Results
ConclusionWhen C # and C/C ++ are InterOP, the most important thing is the two alternative responses, which are as follows:
Unmanage type in wtypes. h
Unmanaged
One of the C + + Knowledge Points series (go + organize)Do not forget to add a semicolon after the class declaration, otherwise there will be many errors!!One of the C seriesOne, #include "filename.h" and the difference between #include#include "filename.h" means that the compiler will find this file starting from the current working directory#include Second, the role of the head fileEnhanced safety testin
AbstractMany people say that C ++ cannot develop ASP. net, ansi c ++ is true, but C ++/CLI is acceptable. In fact, any. net can be used to develop ASP. net, although Visual Studio 2005 is not supported, you can still use what you like if you have learned some tips. net was released ASP.. net.
IntroductionIn Visual Studio. when net 2002 was released, I once heard
multiple threadsLocal variablesScope: local scope (visible only in local scope)Life cycle: The program runs out of local scope and is destroyedMemory Distribution: Stack areaNote: The auto indicator identifiesIt is also important to note that it is critical to master the use of the static keywordTips:If the global variable is accessed only in a single C file, the variable can be modified to a static global variable to reduce the coupling between modu
This is a creation in
Article, where the information may have evolved or changed.
Transferred from: http://tonybai.com/2012/09/26/interoperability-between-go-and-c/
Go has a strong C background, in addition to the inheritance of grammar, its designers and its design goals are inextricably linked to C language. Go is a powerful support for go and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.