IT Community - Software Programming, Web Development and Technical Support

.NET tricks & Tips

This is a discussion on .NET tricks & Tips within the VB.NET Programming forums, part of the Software Development category; Hi Here I am going to post the .NET tricks. Very useful one. You can also post your .NET tips ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > VB.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  3 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 04-13-2007, 06:15 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Thumbs up .NET tricks & Tips

Hi Here I am going to post the .NET tricks. Very useful one. You can also post your .NET tips here.

How to convert a Bitmap to a Byte Array

Here is some simple code that takes a bitmap and converts it to a byte array.

Dim myVar As MemoryStream = New MemoryStream Dim bitmapBytes As Byte()
'Create bitmap Dim bitmap As Bitmap = New Bitmap(50, 50)
bitmap.Save(myVar, System.Drawing.Imaging.ImageFormat.Jpeg)
bitmapBytes = myVar.ToArray
myVar.Close()
bitmap.Dispose()


thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-23-2007, 09:17 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Thumbs up Re: .NET tricks & Tips

Visual C++ .NET File Processing

File Processing in VC++.Net can be by using a class called FileStream. To process a file, declare the FileStream object and use it.

Here is the sample code
String *ListOfStates = S"StatesList";
FileStream *fsStates = new FileStream(ListOfStates, FileMode::Create);
StreamWriter *swStates = new StreamWriter(fsStates);

for(int i = 0; i < this->cboState->Items->Count; i++)
swStates->WriteLine(this->cboState->Items->get_Item(i));
swStates->Flush();
swStates->Close();

Close();
thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/vb-net-programming/1096-net-tricks-tips.html
Posted By For Type Date
Visual C++ Tips & Tricks - DiscussWeb IT Community - Technical Support and Technology Discussions This thread Refback 09-10-2007 04:24 AM
Digg / Programming / Upcoming This thread Refback 07-20-2007 07:21 AM
Digg / Programming / Upcoming This thread Refback 07-20-2007 05:18 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
C# .Net Tips & Tricks oxygen C# Programming 83 09-24-2008 03:20 AM
SAP Tips & Tricks leoraja8 Operating Systems 0 03-29-2008 01:11 AM
BlueTooth tips and tricks devarajan.v Mobile Software Development 52 03-13-2008 10:46 PM
PHP Tips and Tricks Sabari PHP Programming 20 12-18-2007 06:26 AM
SEO Tips & Tricks spid4r Search Engine Optimization 0 03-09-2007 12:03 AM


All times are GMT -7. The time now is 01:24 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0