Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

vb.net Salfy remove (eject) USB device

Posted on 2009-05-09
8
Medium Priority
?
4,254 Views
Last Modified: 2012-05-06
I'm writing a code vb.net (MS visual basic express)
my code is working as following:
1. it detects USB device arrival, and get the drive letter.
2. Using drive letter, it can do some functions on the device.
3. I need a pre-made function that safely remove the external USB device after finish from step2.

It been two weeks of searching for such code with no luck. I've found many codes but non did work for me since most of them give errors in MS visual basic express 2008.
these two codes gave less errors. However, after correcting errors using the editor's suggestions they didn't work as they supposed to!
http://www.xtremevbtalk.com/showpost.php?p=1065704&postcount=13
http://www.vbforums.com/showthread.php?t=528359

So, help be to find suitable (and WORKING) code that disconnects the removable device with the following properties:
1. Target OS = Windows XP
2. Target language = VB.net (MS Visual Basic Express 2008)
0
Comment
Question by:sniper038
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24345914
0
 
LVL 3

Author Comment

by:sniper038
ID: 24346040
@CodeCruiser
Thank for replying, actually I've found lots of working apps that do the same thing I need. But the problem is that I can't find or getting it working in VB.net
I may try to convert the codeproject you've provided into VB but am not sure that i'll be able to achieve that.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 24346054
Do not convert it. I think its a dll. If not, just copy the class into a C# DLL project and compile into a DLL. This way you can use it without converting it.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 3

Author Comment

by:sniper038
ID: 24346081
Huh.... I really have no idea about what you're taking about!

Anyway, if in some way I can do that, Am I going to be able to just call it from my VB code with drive letter passed, and have that drive ejected?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24346090
0
 
LVL 3

Author Comment

by:sniper038
ID: 24346119
OK..
I'll start reading and trying to do the DLL thing the next few days. But however, I would prefer any straight forward solution in VB.net since I only have (MS VB express edition) and don't like to install any further products unless I have to. So, If anyone has that EXTREMITY HARD to implement code in VB.net it will be appreciated and will be considered as the right and exact answer for my question.
0
 
LVL 3

Author Comment

by:sniper038
ID: 24399964
Hi..
I tried to achieve the DLL thing but it gets complicated!!
I still prefer a direct solution with VB.
0
 
LVL 3

Author Closing Comment

by:sniper038
ID: 31579822
it wasn't the solution I wanted but anyway it was the keyword
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question