|
Hi,
Can anybody please give me idea to replace functions 1. GetFileName 2. GetFile 3. Copy of FileSystemObject with the functions of Windows API.
As I have done using CreateDirectory() of Windows API for the method CreateFolder() of FileSystem.
Thanks,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
This is a complete waste of time. The FSO uses those very same functions itself to do it's job. Like I said yesterday, you're not going to gain any performance benefit from doing this.
|
|
|
|
|
Hi,
Is there any more efficient way of concatenating the strings than using "&" for performance wise. so that I can use them in my frequently called functions.
If possible with two line code snippet or any link.
Thanks a Lot,
Md Abdul Aleem.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
http://support.microsoft.com/?id=306821
|
|
|
|
|
Hi,
But I need it in VB 6.0 any idea, can u please share with me.
Thanks,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
|
Why do you think performance is degraded due to using & ?
|
|
|
|
|
I might be wrong, but in .NET when you concatenate a string in that manner it creates a new string object ... hence it's better to use stringbuilder, becuase it merely manipulates that object not creating another... however i might be completely wrong
|
|
|
|
|
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.
|
|
|
|