我们需要自己的代码来开发软件-代替.Net Framework [英] We need our Own Code for Developing Software - Instead of .Net Framework

查看:94
本文介绍了我们需要自己的代码来开发软件-代替.Net Framework的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们创建的大多数软件都使用.NetFrameWork.例如;

VB.NET;

Most Of The Software that we create uses the .NetFrameWork. For Example ;

VB.NET;

imports System.IO
Imports System.Net.Mail



要编写文本文件,通常我们使用System.IO.它是Microsoft创建的可轻松编写文本文件的通用库.

VB.NET>编写简单文本文件



To write a Text File, usually we use System.IO. It is a Common Library Created by Microsoft to easily write a text file.

VB.NET > Writing a Simply Text File

Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write(TextBox1.Text)
objWriter.Close()
MsgBox("Text written to file")



现在的问题是我想编写自己的Class Library(.dll)或class 在VB.NET中编写文本文件.我怎样才能做到这一点 ?但是我不想使用.Net Frame Work或任何其他常见的类!!



Now the Question Is I want to Write My Own Class Library (.dll)or class To Write a Text File in VB.NET. How Can I Do That ? But I don''t Want To use The .Net Frame Work or any other''s common classes !!

推荐答案

几乎不可能.
在基本级别上,所有磁盘IO都由库函数处理,因此在某些时候,您至少必须使用它们.

您可以编写一个使用这些DLL的本机DLL并从VB访问该DLL,但这只是将库推成另一种语言.

你为什么要这样做?为什么不只使用
Next to impossible.
At the base level, all disk IO is handled by library functions, so at some point you have to use those at least.

You can write a native DLL which uses those and access that from VB, but that is just pushing the library into a different language.

Why are you trying to do this? And why don''t you just use
File.WriteAllText(fileName, text)

呢?


当前,没有.NET Framework,就不能使用VB.NET和C#.完全没有,算了吧.

所以有什么问题?不要使用.NET,请使用以C ++编写的本机代码(在代码中提及)或您可以使用的任何其他语言.或使用.NET.

—SA
Presently, you cannot use VB.NET, C# without .NET Framework. Not at all — forget it.

So, what''s the problem? Don''t use .NET, use native code written in C++ (mentioned in your tag) or any other language you can use. Or use .NET.

—SA


好吧,您当然可以将整个Win32 API包装在一个或多个VB.Net类中,但具有讽刺意味的是,您需要.Net才能使用互操作服务在.Net中,这违反了包装Win32 API的目的.

您唯一真正的求助方法是编写完全不使用.Net的非托管代码,这也意味着您必须使用Visucal C ++或VB6.玩得开心.
Well, you can certainly wrap the entire Win32 API in one or more VB.Net classes, but ironically, you need .Net to use interop services in .Net, which kind of defeats the purpose of wrapping the Win32 API.

Your only real recourse is to write unmanaged code which doesn''t use .Net at all, which also means that you either have to use Visucal C++ or VB6. Have fun with that.


这篇关于我们需要自己的代码来开发软件-代替.Net Framework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆