|
I am still getting the blue line under that
Dim currentAssembly As Assemably = Assembly.GetExecutingAssembly()
This one
Thanks
|
|
|
|
|
Bob Beaubien wrote: I am still getting the blue line under that
What is blue line? You need proper imports.
Imports System
Imports System.IO
Imports System.Reflection
|
|
|
|
|
ok I got it now i hade all of them inported but for some reson i delete the y in assembaly and put it back and then it was fine humm
i put that code in a button can i do that like this
I tryed it but it dont work
and for file name you hade put "YourNamespace.ExecutableName.exe"
what do i put for name space ??
Thanks agine your all your help and pations
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim currentAssembly As Assembly = Assembly.GetExecutingAssembly()
Dim resourceFullName As String = "keyboard.exe"
Dim filePath As String = Path.Combine(Path.GetTempPath(), resourceFullName)
Using stream As Stream = currentAssembly.GetManifestResourceStream(resourceFullName)
If Not stream Is Nothing Then
Using file As New FileStream(filePath, FileMode.Create)
Dim buffer As Byte() = New Byte(1024) {}
Dim read As Integer = stream.Read(buffer, 0, buffer.Length)
Do While (read > 0)
file.Write(buffer, 0, read)
read = stream.Read(buffer, 0, buffer.Length)
Loop
End Using
End If
End Using
If File.Exists(filePath) Then Process.Start(filePath)
End Sub
|
|
|
|
|
I noticed in a couple of your code snippets you copy'n'pasted (I hope!) this:
assembaly
It's spelled Assembly .
|
|
|
|
|
Yap i got that
Thare is not more blue lines now
but it will not run
|
|
|
|
|
Hi Everyone,
I have a vb6 application written as a service that interacts with the desktop. The service is designed to control a system that is never logged into by a user.
A function in the service is to enumerate the attached monitor(s) and configure the width, height and rotation based on settings read from an xml file.
The function works if a user is logged in but when the service runs and no user is logged on it fails to a) enumerate the display devices and monitors and b) configure the display settings using these two functions.
The idea is for the service to configure the display settings without having to logon to the computer to perform this task manually.
I think I'm running into problems with winlogon and perhaps the different state when no user is logged in. Does anyone have any information which could assist with getting these functions to work when no user is logged on?
Thanks,
Ben
|
|
|
|
|
Hi,
AFAIK services by default run without user interaction, without desktop, and hence without screen settings. However there is a flag somewhere that allows user interaction, so it is my guess you should enable that, then proceed. Don't ask me any details though.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
The Service is already set to "Allow service to interact with desktop" - this setting is on the Logon tab of the services mmc.
|
|
|
|
|
Services run under a different desktop, not the one users see. You're actually changing the display settings for a desktop that you can never see.
Like Luc said, you have to turn on the option to allow your service to interact with the user desktop. The problem is, since a user never logs in, who's going to see the settings?
|
|
|
|
|
The Service is already set to "Allow service to interact with desktop".
When calling ChangeDisplaySettingsEx I'm using two options that make it permanent and store it in the registry which in effect means it's set globally - including at Winlogon/Screensaver/Default.
When ChangeDisplaySettingsEx runs successfully, you can logoff or even reboot and the settings are still applied.
|
|
|
|
|
lbitben wrote: When ChangeDisplaySettingsEx runs successfully, you can logoff or even reboot and the settings are still applied.
OK, so is the problem solved or do you still have it? If not, then change the service so it's using a user account to login instead of running under LocalSystem. I doubt it's going to work, but it's worth a short.
Other than that, you cannot force those functions to work as you want. You're going to have to find some other method to do what you want. Information on doing this is probably going to be scarce considering noone ever uses those functions from a service.
|
|
|
|
|
I've managed to get EnumDisplaySettingsEx working and it is now enumerating the display adapters and available configurations. I am now trying to get ChangeDisplaySettingsEx working so that it will configure the display.
ChangeDisplaySettingsEx exits with: -1 which is DISP_CHANGE_FAILED, The display driver failed the specified graphics mode.
I have already confirmed the settings I am trying to apply are valid and they work if a user account is logged in when the service runs and attempts to configure the display adapter, but not when a user isn't logged in.
|
|
|
|
|
Is the user account you tested it under an Admin?
|
|
|
|
|
the user account being used is the Administrator account.
|
|
|
|
|
In that case, that's about as far as you can take it. It woujld appera that the function is just not going to work properly from a service.
|
|
|
|
|
'Remaining Text Does Not appear to be a part of the Formula'
getting this error when passing String Data from Vb.net form to Crystal report in VS 2008 , numeric value works fine
this is the code which i am using to pass the value to Formula Field
objReport.DataDefinition.FormulaFields(0).Text = "Company_Name ='" & gCompany_Name & "'"
|
|
|
|
|
Can you put a breakpoint/debug statement/watch on that line and tell us the value of the variable gCompany_Name ?
I are Troll
|
|
|
|
|
|
Error in Formula <ID>.
'Company_Name ='Company Name"
The reamining Text Does Not appear ......
|
|
|
|
|
I'm not using Crystal myself, but could this be a quote-mismatch?
'Company_Name ='Company Name"
How about this?
Company_Name = "" & "Company Name"
I are Troll
|
|
|
|
|
hi experts
i have created one application in vb.net c# and i add new item form2
and i want to set form2 for debug but only form1 is debug when i run this application i want to set from2 for debug
|
|
|
|
|
Set Form2 as start-up form?
|
|
|
|
|
paya1pa wrote: i have created one application in vb.net c#
What?
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
paya1pa wrote: i have created one application in vb.net c#
You are therefore a genius. Stop programming, and start doing lectures, writing books, etc.
It's not possible to write an app in VB.NET AND C#, unless the languages are seperated through dlls.
paya1pa wrote: and i want to set form2 for debug but only form1 is debug when i run this application i want to set from2 for debug
Not true. If you debug, you debug the whole application. Perhaps you need to explain more, because nothing you've said makes any sense.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Ok, so I should know this but I just do not know how to create a global variable in VB.NET i am more used to programming in VB6 and am still adjusting to .NET, so I need to ask how do I create a global variable?
I understand that it would be placed after the Public Class (project name) line but then how Would the syntax be for creating a global variable??? I also already know that I should try to not use global variables but I just am writing a very simple program so dont worry I do know that Global variables sometimes are not the best to use.
Thanks.
|
|
|
|