|
Yup there is...
I think the problem why your application does not run in 'user mode' is that the given user doesn't have sufficient rights to read or write the registry.
First of all you should ask yourself if reading & writing to the registry is really needed. There are several other perfect ways to store application data etc... Have a look at Isolated Storage[^] for example
Second there are a few different permissions required for different 'sections' of the registry. For example HKEY_LOCAL_MACHINE requires admin rights... You may have a look at HKEY_CURRENT_USER. Of course you cannot store 'system wide' information there....
|
|
|
|
|
XP doesn't have this ability. The user has to launch the application using RunAs.
I would suggest, next time, you develop your application under a normal User account, the same as the type that's going to run your application, and not as an administrator. This forces you to take into consideration the restictions the user has to access certain things, like the HKEY_LOCAL_MACHINE hive in the registry.
|
|
|
|
|
Hello,
I have two screens and one - the wrong one - is still active or set to primary screen respectively.
Is there any possibility of changing this?
Thanks in advance.
|
|
|
|
|
...and this has what to do with VB.NET??
Start/Settings/Control Panel/Display is what you're looking for. What you do in there depends on the video drivers you have installed. Consult the documentation that came with your video card.
|
|
|
|
|
... of course it has ...
If I'm posting a question in this forum. It should be clear that I don't want to have an instruction to do this with XP-/graphic tools. Isn't it?! So it would be nice, if you have any idea to solve my problem by using VB.NET.
Thanks.
|
|
|
|
|
I'm developing a simple IVR systemin vb.net using Microsoft's Speech SDK 5.1 and TAPI. My challenge is to integrate these two such that i recongise speech through a telephone line. Can someone please help.. Sample source code would be greatly appreciated.
Nyaguire
|
|
|
|
|
For such a generic query, this[^] is about as close as your going to get for an answer.
|
|
|
|
|
Hi Friends,
This is Aruna.I am working on .Net.I want to know something about SCP(Secure Copy Protocol).Past i am using FTP for file trasfer from one system to another system.Now i have to run with SCP .I don't know how to run that tool. Please How to run SCP with SSH in Windows Application.Can you give the suggestion to do this application.I am WindowsXp.
Aruna.K
|
|
|
|
|
You're going to have to find a 3rd party library that handles this for you, such as this[^]. The .NET BCL doesn't have any support for this built in.
|
|
|
|
|
Hi,
I've narrowed down a memory leak in my application to a single Sub, however, I can't figure out what's doing it. Whenever this Sub is called (SelectedIndexChanged), my memory usage grows by ~100 kb and doesn't go down, according to Task Manager.
Here's my code:
Note:
The following names are Global Variables:
appSelPath
appSelName
appSelAlt
appSelPos
appSelID
canEnable
beenFound
And yes, I need all of these variables as they are used in many other methods within my application.
<br />
Dim selectedText As String = ""<br />
If lbApps.SelectedItems.Count = 1 Then<br />
btnLaunch.Enabled = True<br />
<br />
pbSel.Image = ilApps.Images(lbApps.SelectedIndex + 1) 'lvApps.SelectedItems(0).ImageList.Images(selImg)<br />
<br />
selectedText = lbApps.SelectedItem.ToString<br />
btnLaunch.Text = "Launch " + selectedText<br />
btnMove.Text = strMoveText.Replace("|", selectedText)<br />
'Add Application Routine<br />
If selectedText <> "Add Application..." Then<br />
'set app selected path<br />
For i As Integer = 0 To appListing.Count - 1<br />
Dim lineData() As String = appListing.Item(i).ToString.Split("|")<br />
If selectedText = lineData(0) Then<br />
appSelPath = lineData(1)<br />
appSelName = lineData(0)<br />
If lineData.Length = 3 Then<br />
If lineData(2) = "True" Then appSelAlt = True<br />
Else<br />
appSelAlt = False<br />
End If<br />
End If<br />
Array.Clear(lineData, 0, lineData.Length)<br />
lineData = Nothing<br />
Next<br />
<br />
Dim enableIt As Boolean = True<br />
' Dim appPos As Integer = -10<br />
For i As Integer = 0 To appLaunched.Count - 1<br />
Dim lineData() As String = appLaunched.Item(i).ToString.Split("|")<br />
If lineData(1) <> "wait" Then<br />
If appSelName = lineData(0) Then<br />
enableIt = False<br />
If CInt(lineData(1)) > 0 Then<br />
appSelPos = CInt(lineData(1))<br />
appSelID = CInt(lineData(2))<br />
canEnable = True<br />
End If<br />
End If<br />
End If<br />
Array.Clear(lineData, 0, lineData.Length)<br />
lineData = Nothing<br />
Next<br />
<br />
ContextMenuStrip1.Enabled = True<br />
btnLaunch.Enabled = True <br />
lbScreens.SelectedItems.Clear()<br />
If enableIt = False Then<br />
lbScreens.Enabled = True<br />
btnMove.Enabled = False<br />
canEnable = True<br />
beenFound = True<br />
Else<br />
lbScreens.Enabled = True<br />
btnMove.Enabled = False<br />
beenFound = False<br />
canEnable = False<br />
End If<br />
End If<br />
End If<br />
selectedText = Nothing<br />
I have no idea what's wrong. I've looked at this chunk of code for hours now, and it doesn't seem like I'm making any unusual calls to anything.
Any help is appreciated.
Thanks,
Mitch F
|
|
|
|
|
Mitch F. wrote: Note:
The following names are Global Variables:
appSelPath
appSelName
appSelAlt
appSelPos
appSelID
canEnable
beenFound
Nasty....
What makes you think this is leaking memory ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hmm... so even if global variables are handled correctly, they will still cause an extremely large growth in memory consumption? Is there any more efficient way to carry variables from one sub to another?
|
|
|
|
|
I see no reason for this to leak memory. I assume you really mean it uses more memory than you would like. No object in this method can leak memory.
Globals won't leak, they are just a poor design. Yes, you can pass variables as parameters, or use delegates if classes need to communicate when a value changes.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
Thanks for the responses.
I've created a quick application (using one textbox and one button) to see if global variables are eating up memory and not releasing it, and that seems to be the case.
<br />
Public Class Form1<br />
Dim globalString As String = ""<br />
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged<br />
globalString = TextBox1.Text<br />
End Sub<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
TextBox1.Text = ""<br />
globalString = Nothing<br />
End Sub<br />
End Class<br />
When I add text to the global variable, the memory starts to get eaten pretty quickly, but when I click the button to set the variable to Nothing, the memory still isn't released, but more memory is taken.
Thanks,
Mitch F
|
|
|
|
|
Well, if that's true, that's one more reason not to use globals. However, I'd be inclined to suggest that your methods of watching memory usage are flawed. Do you watch the memory in the task manager ? That's not really accurate.
Also, when I run this, the extra memory usage is minimal. Also, global is not a global, it's a member variable. To be the .NET equivelant of a global, it would need to be static.
Based on the minimal memory usage in the test I just did, I think you're worried about nothing, and certainly should do some reading regarding how the garbage collector works.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
TaskManager ais about the worst tool you can use to see how much memory your app is using. Why??
This is because TaskManager isn't showing you the memory your app is using. It's showing you how much memory is reserved by the .NET CLR Virtual Machine that is running your app. If your app releases managed memory back to the runtime, the runtime holds onto it (as seen by TaskManager) because it's not being released back to Windows. The runtime holds onto it to fill future requests for memory by your application faster. If Windows needs the memory back, the .NET CLR will release any it memorys it has in reserve back to Windows.
If you really want to see how much memory your app is using, use the Performance Monitor and the .NET CLR counters to monitor your app. Task Manager isn't show you how much memory your app is REALLY using.
|
|
|
|
|
Mitch F. wrote: The following names are Global Variables
No, they are not. There are no global variables in VB.NET.
Mitch F. wrote: my memory usage grows by ~100 kb and doesn't go down, according to Task Manager.
The Task Manager doesn't show how much memory your application uses, it shows how much memory the memory management has allocated. When memory is released back to the memory management, it doesn't get released to the system unless the system needs it.
Mitch F. wrote: Array.Clear(lineData, 0, lineData.Length)
lineData = Nothing
Doing things like that only uses CPU time, it doesn't release any memory earlier.
Clearing the array is pointless. When the array is no longer used, the references that it contains are no longer concidered, so all the strings also counts as unused. Actually, clearing the array will keep it in memory longer than if you didn't.
Setting a reference to Nothing only serves a purpose if you later in the code actually check for that Nothing value. Clearing references for the purpose of releasing memory has no effect at all.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi everyone!!
i have a huge problem and i've been working out this one for a long time now. i need your help..
does anyone knows how am i supposed to set the database connection for access if the target computer (the one i am about to deploy the application) is not connected on the network? i have created some applications and executables before and it had perfectly worked because i am using a database that is stored in a server computer and i just configure the connection string based on the shared folder.
my current project work well with that too but i need to install this application to a laptop which is to be brought anywhere (of course) and is not connected on the network. how am i supposed to do this..? i badly need your help guys...
btw, i am using visual studio .net 2002 and my database is in ms access.
thanks a lot in advance!!!
crookshanks
|
|
|
|
|
If your DB is access, then it's just an MDB file, deploy it with your app.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks. i have included the database file in my project. but i dont know how to set the oledbconnection datasource..? i mean, i do not know how to declare the datasource path if my database is included in the project.
pls help.thanks.
crookshanks
|
|
|
|
|
The connection string will just be a path to the file - well, not just that, but it will contain the path to the file. So, you may have to build it in code.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
please help me how i am supposed to do that one.
i need to make a connection to the dataadapter that i am using to access my database. and since the database is included in the project which is stored in my C drive(for example), the path for the connection is in Cdrive also.
my problem is that when i install the application to the target computer, an error occur saying that it can't find the path to the database (since the target computer is not connected to the network)
crookshanks
|
|
|
|
|
crookshanks wrote: an error occur saying that it can't find the path to the database (since the target computer is not connected to the network)
Are you not deploying the database ? You should not keep the files in C drive. Keep it in your application directory and .NET framework provides method to access the current application working directory. So you won't miss the path.
|
|
|
|
|
i have the database included in the project.but i don't get what you mean by "deploying the database". i'm sorry i'm new in vb.net..
and also what you mean by application directory? thanks a lot.
crookshanks
|
|
|
|
|
deploying the database means copying the mdb file onto the target PC
the application directory is the directory in the file system that contains your exe, and presumably your mdb
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|