|
You should be able to use ADO.Net, and the SqlClient namespace classes to do what you want. I would only use the ado.net odbc provider if you think you might someday change to a different database engine. In any case, connection strings for either can be found here[^]
|
|
|
|
|
That was helpful, thanks. I did eventually figure it out. I had to enable TCP/IP connections from external networks and open some ports, but now its working. Thanks!
|
|
|
|
|
say i want to slow down my computer to eventually kill it. in a slow way i wud like to create a buffer overflow how can i do this by coding it in vb??
|
|
|
|
|
In light of your other question, noone is going to help you do this. On top of that, just creating a buffer overrun does NOT slow down the machine.
moneyque wrote: i want to slow down my computer to eventually kill it.
Wouldn't it be more efficient to open the case and drop a brick on the motherboard? Please, try it and tell us what the results were!
|
|
|
|
|
im doing a research project and i am making a virus/bacteria that will have time bomb attach to it, this will signify the incubation period. after the time has passed i want to start deleting .dll and temp files. can anyone help because i have no clue where or how to start.
|
|
|
|
|
moneyque wrote: i am making a virus
moneyque wrote: i want to start deleting .dll and temp files.
You're truely an idiot. Do you really think anyone around here is going to help you write a virus?? Did you know that in the United States, doing so is a federal crime??
moneyque wrote: can anyone help because i have no clue where or how to start.
Thankfully, this is true. Hopefully, it'll stay that way!
|
|
|
|
|
That was awesome, the best I have seen here
|
|
|
|
|
What Dave said, +
Aiding someone in a crime, makes you partially responsible. Here in the Netherlands you can get up to four years in prison, just for giving a helpful answer to this post.
moneyque wrote: research project
It's not funded research?
I are troll
|
|
|
|
|
That was really helpful. Many thanks.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
You're welcome, off course
I are troll
|
|
|
|
|
Hi,
I am working with IMAPI2 and IMAPI2FS to burn a cd or a dvd. The sample code is shown below. I want to show a progress bar to user during cd burning. However datawriter is writing the whole image file at once. How could I generate a progress bar to show to user while it is burning?
<br />
<br />
Public Sub HellBurnIt()<br />
<br />
Dim Index As Int32 = Nothing '**<br />
Dim Recorder As New IMAPI2.MsftDiscRecorder2<br />
Dim Stream As Stream = Nothing<br />
<br />
ProgressBar3.Value = DriverSize<br />
ProgressBar1.Value = DriverFreeSpace<br />
<br />
<br />
'Here we dump all selected files under a temporary directory<br />
'<br />
Dim GetFolderPath As String = TransferFilesToTemp()<br />
<br />
Index = DriverNo ' x numbered drive on the system<br />
<br />
'Create a DiscMaster2 object to connect to optical drives.<br />
<br />
Dim G_DiscMaster As New IMAPI2.MsftDiscMaster2<br />
<br />
'Create a DiscRecorder object for the specified burning device.<br />
<br />
Dim UniqueID As Int32 = Nothing<br />
<br />
UniqueID = g_DiscMaster.Item(Index)<br />
Recorder.InitializeDiscRecorder(UniqueID)<br />
<br />
'Create an image stream for a specified directory.<br />
<br />
Dim FSI As New IMAPI2FS.MsftFileSystemImage<br />
Dim Dir As IMAPI2FS.FsiDirectoryItem = FSI.Root<br />
<br />
'Create the new disc format and set the recorder<br />
<br />
Dim DataWriter As New IMAPI2.MsftDiscFormat2Data<br />
DataWriter.Recorder = Recorder<br />
DataWriter.ClientName = TextBox1.Text<br />
<br />
FSI.FreeMediaBlocks = DataWriter.FreeSectorsOnMedia<br />
FSI.FileSystemsToCreate = FsiFileSystemISO9660<br />
FSI.VolumeName = TextBox1.Text<br />
<br />
' Add the directory and its contents to the file system <br />
Dir.AddTree(GetFolderPath, False)<br />
<br />
'Create an image from the file system<br />
'<br />
Dim Result As IMAPI2FS.FileSystemImageResult = FSI.CreateResultImage()<br />
<br />
Stream = Result.ImageStream<br />
<br />
DataWriter.Write(Stream) ' Here data writer writes the whole image <br />
<br />
End Sub<br />
<br />
<br />
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
I've never used the IMAPI2 classes, but from a quick scan of the documentation, you'd have to create an event handler for the IMAPI2.MsftDiscFormat2Data.Update event and wire it up with AddHandler.
|
|
|
|
|
i downloaded a thermometer panel but i cant figure out how to get it into visual basic. there are some files from the download but vb wont open some, what do i do
|
|
|
|
|
Send a message to the developer of the thermometer panel?
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
need some guidance, I have a collection of properties 166 to be spacific, each object in the collection will spawn a thread to perform a long running task, I also want to pump meessages back to the calling thread. threadpool will provide me the solution unfortunatly MS has limited the number of threads to 25 per processor, simple math will tell me that I need a huge box.
so that another approach would be to loop from 0 to max threadpool and spawn an instance of a thread pulling the objectid from the collection based on the threadid. that's fine or the first 50 objects. how would I now pull the remaing objects from the collection.
example
for i as 0 to threadpool.maxthreads -1
dim node as basenode = basecollection(i)
dim rem as new workernode(node)
addhandler rem.messageback new messagehandler(addressof OnMessagesReceived)
rem.dowork
next
assuming dual CPU will make the maxthread value be 50 and my basecollection will hold 166 objects
I am stuck spawning objects 51-165
|
|
|
|
|
With .NET 2.0 SP1, the default was changed from 25 threads per core to 250. This is not to say that using 250 is a good design. Seriously, if you think you need more than 25 threads per core running, you really need to reconsider your design. You'll be wasting so much time in context switching, it's silly.
Also, the ThreadPool throttles it's new thread creation to 2 per second once the thread count exceeds the number of cores running the threads. So, on a single core machine, it'll still take well over a minute to create all of your threads.
Now, having said all that, you can't change the MaxThreadPoolThreads limit in managed code.
|
|
|
|
|
this is good to hear, even though the collection will hold 165 objects, it's unlikly I will actualy spawn all 165 threads at once, each object will represent a pop3 client, that will pop a mailbox return all it's mail perform some formating, auto alerting and store the results in a DB then die. the reason for spawing as many as possible at once is reduce the time between poping, also the reason for passing messages back is for the management interface to watch activity through ipclient....
|
|
|
|
|
Hi All,
After A long time.. Hope u all are good..
I am having btnUpload and btnTransfer. On btnUpload I open a openFileDialogue select any type of file and at transfer i want to transfer it to another location suppose D:\TransferTest\.
But its giving this error Could not find a part of the path 'D:\TransferTest\'.
The code is as below :
Dim filename As String
Dim ofd As OpenFileDialog
Private Sub btnUpload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpload.Click
ofd = New OpenFileDialog()
ofd.Filter = "All Files|*.*"
ofd.ShowDialog()
If ofd.ShowDialog() = Windows.Forms.DialogResult.OK Then
filename = ofd.FileName()
txtFile.Text = filename
End If
End Sub
Private Sub btnTransfer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTransfer.Click
File.Copy(filename, "D:\TransferTest\")
End Sub
Help with a code tip... its a urgent..
Regards,
Sourabh
Thanks and Regards,
|
|
|
|
|
Try using the new filesystem namespace:
FileSystem.FileCopy(filename, "D:\TransferTest\")
|
|
|
|
|
Hi,
in Windows you can only create/move/copy files to existing folders, so if either D:\ or D:\TransferTest\ does not exist, you would get such error.
You should use Directory.CreateDirectory() to create a folder (no need to test for existence first!).
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Private Sub btnTransfer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTransfer.Click
if not io.directory.exists("D:\TransferTest\") then
io.directory.createdirectory("D:\Tran.....")
enf if
File.Copy(filename, "D:\TransferTest\")
End Sub
|
|
|
|
|
so far for "no need to test for existence"...
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
First post here so please be patient, I wrote some software for the company that I work for in VB6 for Scheduling and quoting construction based projects and am upgrading to VB 2008, not a problem except for the printing, The user had several check boxes and option groups which related to which pages were printed, each unrelated, the first was a cover page, second page a preamble, third page list of doors etc all taken from different sources, in VB6 it was pretty simple to create a printer object (called myPrint) call the various page sub routines and to put it together example as below:
Select Case True
Case frmPrint.optAll(0).Value = True 'materials listing
MyPrint.NewPage
PProductListingA
Case frmPrint.optAll(1).Value = True 'bill of quantities
MyPrint.NewPage
PBOQsA
Obviously we've lost the NewPage which has been replaced with HasMorePages from with the PrintPage method, I've spent about a week now trying to call the various sub routines from within this and quite simply have hit a brick wall. Lots of examples on the web to point me in the right direction but they all seem to be based around a single block of text printed over various pages, help.
|
|
|
|
|
I cannot help you exactly on your problem, but Microsoft has an excellent article on printing in .NET:
http://msdn.microsoft.com/en-us/magazine/cc188767.aspx[^]
It helped me a lot to learn about printing in VB.NET. Note that there's some source-code relating to the article which also deals with multi-page texts. Maybe it's worth to have look. There is also a lot neat stuff in it, like status texts in status bars, print preview and so on.
|
|
|
|
|
Thanks for the suggestion, unfotunately it still only deals with a multi page single source document as opposed to a different document on mulitple pages.
|
|
|
|