|
Yes friend but it is in .Net, but now I want to do same kind of thing in by using VB 6.0. Yesterday I have seen a question which is replied by some one with similar answer, but forgot to notedown the link. Missed it.
Can any of you please help me yaar.
Thanks a Lot,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
You need an external library or your own class do this. VB6 does not have an equivilent to StringBuilder built into it.
|
|
|
|
|
Hi Dave,
I studied yesterday that in some thread some one answered as below
"Its very bad way of creating path, please do it as below" and the code it written over there for concatenating the path, but I have not noted down the link. I guess u were there in the thread, but I am unable to get it from where I got it.
If u can recollect it please help. just a request.
Thanks,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
What the ____ are you talking about?? What does this have to do with string concatenation performance?? And yes, string concatentation is a bad method for building fully qualified filepaths.
|
|
|
|
|
I'd say he's looking for some kind of Path.Combine() for VB6. But that's just my guess...
|
|
|
|
|
Yes friends what he is saying true. Can any of you give me some Idea. I would be very much thankfull.
Thanks,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Yes how can I use it in VB 6.0, if possible please give me some Idea.
Thanks a Lot,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Basically im after an application that will enable autologon, http://technet.microsoft.com/en-us/sysinternals/bb963905.aspx[^] then write to the boot.ini file and add /safemode:network and then run an application upon logon. with a button to undo the changes.
so far have found the following script:
'SafeModePrep.vbs
Const ReadOnly = 1
Dim objFile
Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("C:\Boot.org") Then
Set objFile = objFSO.GetFile("C:\Boot.org")
If objFile.Attributes And ReadOnly Then objFile.Attributes = objFile.Attributes Xor ReadOnly
objFSO.DeleteFile "C:\Boot.org"
End If
objFSO.CopyFile "C:\Boot.ini", "C:\Boot.org"
arrData = Split(objFSO.OpenTextFile("C:\Boot.ini").ReadAll, vbNewLine)
Set objFile = objFSO.GetFile("C:\Boot.ini")
'Remove ReadOnly attribute, if it exists
If objFile.Attributes And ReadOnly Then objFile.Attributes = objFile.Attributes Xor ReadOnly
objFSO.DeleteFile "C:\Boot.ini"
Set objFile = objFSO.CreateTextFile("C:\Boot.ini")
strDefault = "default"
For Each Item In arrData
If InStr(Item, "default") > 0 Then
strDefault = Mid(Item, InStr(Item, "=") + 1)
objFile.WriteLine Item
ElseIf InStr(Item, strDefault) > 0 Then
objFile.WriteLine Item & " /safeboot:network"
Else
objFile.WriteLine Item
End If
Next
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing
Any help would be much appreciated, im only a real beginner at programming
|
|
|
|
|
Are you sure Safe Mode is going to let a program start at logon? If I may ask, out of curiosity, what you are ultimately trying to accomplish?
|
|
|
|
|
Help with what?? You haven't asked a question yet.
Boot.ini (which is now deprecated under Vista and Windows 7) is just a text file. Read it, parse it up, modify the parsed data, write it back out. Oh, you have to strip off the ReadOnly attribute of the file first.
The registry change is easy too. See the Registry class.
And rebooting Windows is just a matter of calling the Win32 API function ExitWindowsEx.
|
|
|
|
|
I have a pop-up window that gets displayed after a button has been evoked on the parent window.
The pop window contains an img with text that conveys to the user that the current file is downloading and an iframe.
The iframe does the bulk of the work ... it populates a infrigistics grid that inturn populates an xls document that gets compressed ... and so forth ... however the problem arises when one wants to navigate to another page from the parent page... it takes long to load another page.
It's very confusing what is the link beween a popup window and it's parent
|
|
|
|
|
So this has nothing to do with Visual Basic? If so, ask it in the ASP.NET forum, please.
|
|
|
|
|
hmm ... does it not say VB.NET what does that mean sorry i'm new here
|
|
|
|
|
It sounds like you're making a webpage, right? You'll get better help with that stuff in the ASP.NET forum.
|
|
|
|
|
Thanks i have posted there as well..... thanks though
|
|
|
|
|
Hi Guys..
I'm just new in programming with registry key..
my problem is if the user is log as a limited user (LOCAL USER)
i just encounter a error about registry permission
can you help me about this..
this is my code:
Dim Xuser As String = Environment.UserDomainName _
& "\" & Environment.UserName
Dim rule As New RegistryAccessRule(Xuser, _
RegistryRights.WriteKey, _
AccessControlType.Allow, _
PropagationFlags.None, _
AccessControlType.Allow)
rootkey.GetAccessControl.SetAccessRule(rule)
rootkey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
rootkey.DeleteValue("bitz")
thanks.. hopefully you guys can help me.
Bitz
|
|
|
|
|
Just about the entire HKEY_LOCAL_MACHINE hive is read only to non-admins. Users cannot grant themselves more permissions than they already have.
You have no choice but to run this app as an adminstrator. As an admin, granting users write permissions to the Run key is asking for trouble.
|
|
|
|
|
is there other way..???
coz the program need to run in user group logon
your help is badly needed..
thanks..
Bitz
|
|
|
|
|
Then this registry value must be set by an Administrator. Users will not be able to do this. Something like this is normally done by the application's installer, which is always run by an Admin.
|
|
|
|
|
Dave Kreskowiak wrote: Something like this is normally done by the application's installer, which is always run by an Admin.
For very good reason, too.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
U can try this may be it will work. Run program in local user use operation "Run as" may be it wil work
|
|
|
|
|
non-bugging Errors wrote: Run program in local user use operation "Run as" may be it wil work
Quote Selected Text
As Dave mentioned, this can potentially ask for trouble doing so.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I have a DGV w/20 columns (4 hidden). The default column sort works fine except for one column which I would like to sort based on the value of a hidden column.
Primitive Example:
Column 5 = Cost (String)(visible)
"1 Apple"
"1 Apple, 2 Oranges"
"2 Oranges"
Column 20 = TotalCost (Integer)(hidden)
1
3
2
When the user clicks on the column for sorting I should display:
"1 Apple"
"2 Oranges"
"1 Apple, 2 Oranges"
Question: How do I intercept the sort event for a specific column and use a different field to sort the results?
|
|
|
|
|
Intercepting the event - oncolumnclick
Detecting the column clicked - e.index I think
custom sorting - you will probably need to write your own, I'd be surprised if there is not an article here already.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for the reply. I Implemented the following to solve it (using the fruit example):
<br />
Private Sub SortButton_Click(ByVal sender As Object, _<br />
ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGridView1.MouseClick<br />
<br />
Dim hit As DataGridView.HitTestInfo = DataGridView1.HitTest(e.X, e.Y)<br />
If hit.Type = DataGridViewHitTestType.ColumnHeader Then<br />
If DataGridView1.Columns.Item(hit.ColumnIndex).Name = "Fruit" Then<br />
<br />
Dim oldColumn As DataGridViewColumn = DataGridView1.SortedColumn<br />
Dim newColumn As DataGridViewColumn = DataGridView1.Columns.Item("FruitCount")<br />
Dim direction As ListSortDirection<br />
<br />
' If oldColumn is null, then the DataGridView is not currently sorted. <br />
If oldColumn Is Nothing Then<br />
direction = ListSortDirection.Ascending<br />
Else<br />
' Sort FruitCount again, reversing the SortOrder.<br />
If Me.DataGridView1.SortOrder = SortOrder.Ascending Then<br />
direction = ListSortDirection.Descending<br />
Else<br />
direction = ListSortDirection.Ascending<br />
End If<br />
End If<br />
<br />
' Sort the grid based on FruitCount<br />
Me.DataGridView1.Sort(DataGridView1.Columns("FruitCount"), direction)<br />
DataGridView1.Columns("Fruit").HeaderCell.SortGlyphDirection = direction + 1 <br />
Else<br />
DataGridView1.Columns("Fruit").HeaderCell.SortGlyphDirection = SortOrder.None<br />
End If<br />
End If<br />
<br />
End Sub<br />
The other columns have autosort, so if the column I'm looking for is not selected (or any other random click) it just falls through to the default handlers. Also using column name instead of index since I allow the user to move (some) columns.
|
|
|
|