File I/O And Registry :: Recursion In Datagridview Not Working

Aug 13, 2009

In my application I am selecting a folder path and then asking the user if he/she wants to display full path or file names only.

My problem arises when I want to insert the results in a datagridview. The datagridview has 2 columns:

column1 ----> shows file name

column2 ----> shows file size in MB.

with the below code I get the file name and then the file size on the same column one after the other

I want to show as follows:

File Name Size (MB)
sample.txt 1.2
myspreadsheet.xls 0.6
Seanie.bmp 0.8

What do I need to modify in order to achieve this?

Code:

View 2 Replies


ADVERTISEMENT

File I/O And Registry :: Clipboard Gettext Not Working

Sep 12, 2009

I've got a program which sets focus to a web browser, selects all and copies to clipboard. all of this works.my problem is pasting from the clipboard. I want the text pasted into a new file which I can create and open programatically but when I place clipboard.gettext in the parenthesis as the string to send to the file, nothing happens. there's no error and nothing gets pasted to the target file.i've confirmed the copy on the windows clipboard viewer just can't get it to write it to the file. (also tried just setting a textbox's text property to clipboard.gettext for testing purposes but it still does nothing)

View 1 Replies

File I/O And Registry :: Import From Excel To Datagridview?

Nov 24, 2011

I am unsure of how to import from excel to a datagridview.I have a excelshet called ImportContacts and the Sheet name is the Default Sheet1.

View 1 Replies

Working With 32 & 64 Bit Registry

Sep 24, 2010

I've got a 32bit app & the following reg key works fine in 32 bit operating systems but not 64bit systems.

[Code]...

View 2 Replies

File I/O And Registry :: Error Is Coming Registry Access Is Not Allowed.While Opening A Key

Jan 21, 2009

Error is coming Registry Access is not allowed.While Opening a Key.

Code:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
NewDelete("HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun", "Sonia")
End Sub

[CODE]...

View 1 Replies

File I/O And Registry :: Writing (Default) And Dword(binary) Entries To Registry

Jan 31, 2009

I've had a bit of a look around the net and on the forums but I've yet to find an answer to my question. I've got Visual Basic 2008 Express and I'm trying to write some registry entries, I can write strings fine just using

[Code]...

View 1 Replies

VS 2008 Working With The Registry?

Mar 5, 2010

Dim rk As Microsoft.Win32.RegistryKey
rk = My.Computer.Registry.CurrentUser.OpenSubKey("SYSTEMCurrentControlSetControlSession ManagerBootExecute", True)
rk.SetValue("BootExecute", "autocheck autochk /p ??C:")

I'm trying to make a application that will start "Check Disk " on boot time.But i get this error

Object reference not set to an instance of an object.

View 3 Replies

File I/O And Registry :: Email Accounts Stored In Registry

Jul 14, 2011

Currently, I am try to get the email addresses that have been saved or stored by the user of the computer. This isn't the emails that the user has sent or received, or the contacts he/she has in his address book. Just simply the email accounts that have been accessed from the computer.I know that there are some locations stored in the registry that have the email account. The email addresses that are used on the current computer. I just can't seem to find them on my computer.I am not sure if the registry is the only place to find it or if it stored on the web browser such as internet explorer or google chrome.

View 1 Replies

File I/O And Registry :: Reading Multiple Keys From The Registry?

Aug 27, 2008

I am writing an application that connects to a specific com port. This com port can change depending on how many physical ports are on the PC, and if other USB devices have installed com ports before this one.

I have the communication to the com port all working great, but I need to get the com port description not just the "COM#" which is all I currently get.

I found in the registry where the description is stored but am having trouble doing what I need.

In this key:

Code:
HKEY_LOCAL_MACHINESYSTEMControlSet001ControlClass{4D36E978-E325-11CE-BFC1-08002BE10318}

there is a varied number of sub keys. The are numbered 0000-NNNN depending on how many ports you have. Inside each of these keys, there are multiple values, although I am only interested in one or 2 of them.

My problem is, that I do not know how to get a list of the subkeys (the 0000-NNNN keys/folders) from the original key I posted. I have looked through a few registry tutorials, and I can view the default value in the listed key, but I could not find how to list the subkeys of the listed key.

Does anyone have any sample code they could share that shows how I can get a listing of subkeys, and then run through those subkeys checking for a specific value in one of the strings contained in the subkey?

I am using VB.net 2008 and Windows XP.

View 1 Replies

Windows - Working With Registry Values?

Oct 6, 2010

This time i'm tring to work with registry values and so i'm using the following code Private Function RegKeyExists(ByVal hKey As Long, ByVal sKeyPath As String) As Boolean

[Code]...

View 1 Replies

Registry Key Code Not Working In Windows Vista

Feb 28, 2010

I have the following code in my application and the code works fine in Windows 2000, XP but for some reason does not work in Windows Vista, is someone able to help me with this?[code...]

View 8 Replies

Registry Key Code Not Working In Windows Vista?

Feb 28, 2010

I have the following code in my application and the code works fine in Windows 2000, XP but for some reason does not work in Windows Vista, is someone able to help me with this?

dim myReg as string = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINESoftwareMyCompanyMySoftware", "Path", Nothing)

View 12 Replies

File I/O And Registry :: Can't Read / Write To Registry

Jan 21, 2012

I have several programs that must write to HKLM in XP and Windows 7/64 Pro.The programs work in VB6 but not in VB.Net 2008 on target machines. It does works on our development machine. [code]I just cannot figure out why VB6 works but .net doesn't and fails only on the target machine not the development machine.

View 2 Replies

File I/O And Registry :: Change Permissions Of A Registry Key

Mar 16, 2010

How can I change the permissions of a registry key. I want to allow anyone in the "Users" group to be able to write to "SOFTWAREMyApp".

View 2 Replies

VS 2010 Reading 2 Different Registry Keys / Partially Working

May 31, 2012

this works partially but if I close the reg key as shown I get an error [code]So my question is how/where do I place the Myreg.close and OldReg.Close commands???

View 3 Replies

File I/O And Registry :: Change Value In Registry?

Oct 17, 2009

I need to be able to change a line in the regisrty an am not sure how to go about it, i have searched but nothing i can understand at the moment.

Code:
HKCU,"SOFTWAREMicrosoftInternet ExplorerDesktopGeneral","Wallpaper",0x00020000,"%SYSTEMDRIVE%WebDreamSceneBeach.html"

The part in bold is the part i need to be able to change as i am having to write a little program to change the background on the desktop.

I should be ok once i know more on how to do things like this.

View 2 Replies

File I/O And Registry :: Writing To The Registry?

Oct 27, 2010

I just bet the answer to this question already exists, however I saw no search mechanism under the forum. Anyhow, I would like to change registry data, and this code is asking for an instance to the object.

Dim RegKey As RegistryKey = My.Computer.Registry.LocalMachine.OpenSubKey("HKEY_CURRENT_USERSoftwa reAnyDWGSoftwareDWGtoPDFProSettings", True)
RegKey.SetValue("OutputPDFFileOpt", 1)

Finally, I want to apply this setting to the program on four different computers (local, and three others on the network).

View 1 Replies

Sort Not Working Datagridview Gives "DataGridView Control Must Be Bound To An IBindingList Object To Be Sorted?

Dec 4, 2009

I have a few classes, one is a form, the other is the source of the datagridview. I want to be able to sort the columns of the datagridview by clicking on the header. Here are the classes that I am dealing with:

Imports DiscoveryByte.AddTools.Misc_Tools
Public Class ViewDiscoveryFlashCards
Private DBBindingSource As New BindingSource

[code].....

View 1 Replies

.net 3.5 - Recursion With XML Literals?

Jul 28, 2009

I have a class called Profile that has some simple properties and then it can have a collection of ProfileItem that again has some simple properties and then it can have a collection of ProfileItem (RECURSION). Now I am trying to generated a very simple save function using XML Literals that come with VB.NET (3.5).

[Code]....

View 1 Replies

Is It A Recursion Call

Oct 16, 2010

The code is from a text book.[code]SetProgress is referenced within SetProgress, I don't understand it.Is it a recursion call?

View 4 Replies

Recursion Error Down To One Subroutine

Jun 21, 2012

I've tracked a recursion error down to one subroutine, So when my form loads, it populates some listboxes from a database; any one of these causes the error:
ListboxQuery("select sculptname, sculptid from sculptures;", CloseSculptList, "sculptname", "sculptid")
ListboxQuery("select distinct eventtype from events;", EventTypeList, "eventtype", "eventtype")
'etc, etc

And here's the subroutine (it's querying a MySQL database):
Public Sub ListboxQuery(ByVal queryText As String, ByVal resultObject As Object, ByVal resultDisplay As String, ByVal resultValue As String)
'queries the database for a 1- or 2-column list of values to display in a listbox
Dim myCommand As New MySqlCommand
Dim myAdapter As New MySqlDataAdapter
[Code] .....

The error is the standard recursion error:
An error occurred creating the form. See Exception.InnerException for details. The error is: The form referred to itself during construction from a default instance, which led to infinite recursion. Within the Form's constructor refer to the form using 'Me.'

This is weird for two reasons: One, as you can see, the subroutine doesn't refer to the form at all, so I don't see how it could cause a recursion error, and two, I wrote this subroutine almost a year ago and it only caused this error last week.

View 10 Replies

Asp.net - Implement Selection Sort In .net Using Recursion?

Oct 20, 2010

I am trying to implement Selection Sort in vb.net using recursion. Problem is that I keep getting stackoverflow if the array I want to sort is 1000 elements. I can't find the problem. I don't know much about stack overflow or how to check it. From my research the problem could be infinite recursion but I check for that and exit the sub.Here is the main code:

Public Class SelectionSort
Inherits DefaultSort
Public Sub New(ByVal num As Integer)

[code]...

Everything should work as far as I know. It works on an array of 10 elements and an array of 100 elements.

View 1 Replies

Calculate The Factorial Of Given Number Using Recursion?

Mar 29, 2010

calculate the factorial of given number using recursion.input the number in textbox and show the

result in another textboxrajeev ranjan, on 29 March 2010 - 12:38 PM, said:calculate the factorial of

given number using recursion.input the number in textbox and show the result in another textbox.

View 3 Replies

VS 2010 Converting Recursion To Iteration?

May 10, 2010

Is it possible to make this function iterative or must it be recursive?

The Function traverses a grid of x length and y height. At each point in the grid, it checks all of it's neighbors to see if they are valid, meaning they exist in the grid and haven't been used yet.

The function works in it's current form but I was wondering if an iterative version would be more efficient.

PathManip is a Stringbuilder, stores the path currently being manipulated. PathQueue is a List(Of String), stores all paths yet to be traversed.

IsPathAlreadyUsed is a boolean function that checks whether or not a specified point has been used in the current path.

Sub FindNeighbors(ByVal coords As String)
Dim x As Integer = CInt(coords(coords.Length - 2).ToString)
Dim y As Integer = CInt(coords(coords.Length - 1).ToString)

[Code]....

View 18 Replies

LINQ Recursion - Getting All Items For Specific System?

Dec 3, 2010

I have a situation where I have a hierarchy. I'm trying to use LINQ to get all of the items throughout the hierarchy as opposed to For Each loops. I spent some time looking for examples, but most where C# using lambdas, and I'm not quite sure I understand it. I'd like to try to get all of the Items for a specific system, the levels of items could be n-levels deep.

Code:
System
SubSystem1
Item1
Item99
Item100
Item2
Item121
Item3
SubSystem2
Itemx
Itemy
Itemz

View 6 Replies

Rewrite This Recursive Function To Remove The Recursion?

Dec 29, 2009

I got that little function(I changed the name of variables)

Private Function everythingLinked(ByRef myClass As cls, ByVal found As Boolean) As Boolean
If Not found AndAlso myClass.checked = False Then
myClass.checked = True

[code]....

I want to rewrite it so it would only be loop and no recursion and I'm currently lost?I'm passing a class to this function(with a starting value for found as false) to know if it is linked to the middle of the tree. The class got an array with a maximum of 4 link to other class and it can be circular(this is why I have a checked_link boolean).It does the recursion until there is no more link(return false) to check or until it find the middle link(return true).

edit?for an example, this

in pos 0 got link with 1
in pos 0 got link with 6
in pos 1 got link with 0

[code]....

middlepoint would be pos 15 the code above can prove that every position can be linked with the middlepoint so initial arg would be

everythingLinked(random pos, false)

and in this case it would be always true

View 5 Replies

VS 2010 - Form Constructor Recursion Exception

Aug 15, 2010

I developed an app, tested on few computers and all seemed fine. But now, some people suddenly get an error, which I can't repeat on my computers. Part of the exception:

** Exception Text **
System.TypeInitializationException: The type initializer for 'NumoABC.functionsBurtuSummas' threw an exception. ---> System.InvalidOperationException:
The form referred to itself during construction from a default instance, which led to infinite recursion. Within the Form's constructor refer to the form using 'Me.'
at NumoABC.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 180
at NumoABC.My.MyProject.MyForms.get_MainForm()
[Code] .....

The If Me.Created = False Then is because while the form is loading, some events fire the updatePersonDataHandlers() sub, but I don't want it to happen until form is fully loaded. In the module functionsBurtuSummas line 2
Module functionsBurtuSummas
Private f As MainForm = MainForm
I have many modules who work with the MainForms' controls, so I use a private variable f to refer to the MainForm.

View 28 Replies

File I/O And Registry :: Registry Entry Found/not Found Messages?

Aug 13, 2011

Currently I am using this code to check for Firefox on a 32 bit machine

Code:
Dim Firefox32 As String
Firefox32 = My.Computer.Registry.GetValue _
("HKEY_LOCAL_MACHINESOFTWAREMozillaMozilla Firefox 5.0in", "PathToExe", Nothing)
MsgBox("The value is " & Firefox32)

If the value is found then the above message is fine, but if the entry is not found I want it to display a message like: "Firefox could not be found" instead of "The value is: " What code would make this appear?

[Code]...

View 4 Replies

VS 2010 - Recursion Error With Checked Menu Items

Feb 13, 2012

I've got a menu with checkable items that appears on two different forms, and I'm making sure the two forms always have the same check states, so Form1 would have something like this:

Private Sub mnuWarnings_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWarnings.CheckedChanged
'when one of these is checked, the other should also be

[code].....

But that yields this error:

An error occurred creating the form. See Exception.InnerException for details. The error is: An error occurred creating the form. See Exception.InnerException for details. The error is: The form referred to itself during construction from a default instance, which led to infinite recursion. Within the Form's constructor refer to the form using 'Me.'

There definitely aren't any references to Form1 within Form1.It only occurs when I use CheckedChanged--if I use mnuWarnings.Click, it works fine. And it only occurs in Form1 (the main form); CheckedChanged works fine on Form2.

View 1 Replies

File I/O And Registry :: Binary File Primer - Read The Nth Record Without Reading The Whole File?

May 4, 2009

I need to write data to a file, preferably in binary format, but I am unaccustomed with the concept. Where's the easiest place to get the basics? I could come here with a specific need, but I'm at the point right now where I am more willing to work within the confines of keeping it simple.

Here's what I know:
1. how to open a new file
2. how to specify the record length
3. how to close the file

Some specific questions:

Does the record length have to be constant throughout the file?

Can I read the nth record without reading the whole file?

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved