Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Most Of The Software that we create uses the .NetFrameWork. For Example ;

VB.NET;
VB
imports System.IO
Imports System.Net.Mail


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
VB
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write(TextBox1.Text)
objWriter.Close()
MsgBox("Text written to file")


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 !!
Posted
Comments
JackDingler 2-Dec-11 10:23am    
You can write extension classes in C++.

Microosft documents the process well and it's beyond the scope of a quick answers forum.

You'll still load some of the .NET Framework as VB apps need them to operate.
Sergey Alexandrovich Kryukov 2-Dec-11 10:27am    
Why on Earth?!
--SA
Captain Price 2-Dec-11 10:28am    
So where can I learn those things ?

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)
instead?
 
Share this answer
 
Comments
Captain Price 2-Dec-11 10:30am    
To be a real programmer. Real programmers don't use other's code for doing something !!!
OriginalGriff 2-Dec-11 10:36am    
Since when!
I started with assembler and FORTRAN, and trust me, Real Programmers use other peoples code all the time! Or where you discounting Compilers, linkers, library managers, assemblers, and bootstrappers?

You cannot start from scratch with C#, or C++ - they both rely very heavily on an existing code base.
The only apps you find that start from scratch and rely on no library code at all these days are embedded projects, (which rely on an cross-assembler or cross-compiler for the target microprocessor. And even then, I will take code from existing projects if it saves me a month of utility writing, testing and documenting.

Don't try to re-invent the wheel here, you are throwing away man-millennia of hard work - to produce something that probably won't be as good...
Captain Price 2-Dec-11 10:53am    
So it's not so easy to do it my own way. Isn't it ?
Albert Holguin 2-Dec-11 10:39am    
Wow, you must not be a programmer.
OriginalGriff 2-Dec-11 10:50am    
Damn! Sussed at last!
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
 
Share this answer
 
Comments
Albert Holguin 2-Dec-11 10:41am    
It is kind of hard to avoid .Net when using languages that are pretty much written for the framework...lol
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.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 2-Dec-11 11:17am    
My 5. If your read naive OP's comment you will see that your first paragraph is well over his head. I think you see it yourself though; just a note.

Cheers,
--SA
Is this for yourself or your employer?

If it is for your employer, you would do best by sticking with .Net and what ever else they develop code with.

If you want to learn the finer points of software development on Windows, you should look into C or C++. These languages have their own libraries much like System.IO, however, they are not nearly as complete and feature rich as the .Net interfaces.

Provide some more clarity on exactly what you are looking to do, and I think we can give you some better direction.
 
Share this answer
 
Comments
Captain Price 2-Dec-11 11:42am    
Yes, As I think, VB.NET is nothing about programming. I should learn C++.
JackDingler 2-Dec-11 12:19pm    
That sort of thinking can be a career inhibitor.

Anytime you write a series of instructions to be processed by a machine, you are programming. Even creating punch tapes for 19th century looms is a form of programming.

And seriously, I knew folks in the last century who argued that writing code in 'C' was not programming. Real Programming was done in assembler. Dont'cha know.

Programming languages are just a tool. You pick the tool for the job.

Perhaps if you explained what kind of application you want to write, folks here can suggest the best language for the job?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900