|
Then you did something else, though I have no idea what it is. All that's required is to add the Imports statement at the top of your code and declare a variable as RegistryKey. You'll have to post the code your using, including the Imports section, and the code around where your having the problem.
Imports Microsoft.Win32
.
.
Public Class myForm
.
.
Private Sub myMethod(some parameters...)
' Creating a Subkey
Dim regKey As RegistryKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE", True)
regKey.CreateSubKey("MyApp")
regKey.Close()
End Sub
End Class
There is nothing to this... If you get the little squiggly line under RegistryKey it means that the Microsoft.Win32 namespace has not been imported.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm assuming that you are forgetting to turn the write ability on for the current key....
Dim myKey as RegistryKey = Registry.LocalMachine.OpenSubKey("Software",True
The boolean value must be set to true when opening a sub-key because the default is read-only.
Hope this helps.
|
|
|
|
|
I am building a windows service. This service does a lot of things and runs inte the background but I need an interface for the user. This interface can't be loaded when logged of, but I want to load that when the user has logged on. Alternatively I would like create a notifyicon for the service. Is this possible? How do I do that?
thanks
--- neteject.com - Internet Solutions ---
|
|
|
|
|
This is entirely possible.
You will need to make use of the System.ServiceProcess.ServiceController class to interact with the service.
Create an application that uses this class of the .NET Framework. You will want to place the application for this server in the startup folder.
Hope this helps you get started.
|
|
|
|
|
Hello,
I wanted to know if it is possible to explicitly (implicitly?) lock an
xml file during a job (parsing, modifications, etc)
Thanks
Sumit Domyan
Software Developer
ANALEC INFOTECH
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_webdav_lock.asp
Well.. later
|
|
|
|
|
Hey i have been trying to use this[^] code project article.
I want to use this article to show the progress of my uploading process.
Unfortunatley i am unable to get the progress bar to increase as i am using a separate class to upload my files which implements from an interface and i am having trouble incrementing the counter i which i have declared globally.
my code is below from using this article
<br />
Private Sub btnPublish_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPublish.Click<br />
<br />
Dim Progress As New ProgressWindow<br />
Progress.Text = "Work"<br />
System.Threading.ThreadPool.QueueUserWorkItem(New System.Threading.WaitCallback(AddressOf PublishingFiles), Progress)<br />
Progress.ShowDialog()<br />
<br />
End Sub<br />
<br />
Private Sub PublishingFiles(ByVal status As Object)<br />
<br />
Dim callback As ProgressCallback = CType(status, ProgressCallback)<br />
Try<br />
callback.Begin(0, 100)<br />
Dim i As Integer = 0<br />
While i < 100<br />
callback.SetText(String.Format("Performing op: {0}", i))<br />
callback.StepTo(i)<br />
If callback.IsAborting Then<br />
Return<br />
End If<br />
<br />
''''''''''''''MY CODE'''''''''''''''<br />
<br />
strPublisher = tbPublisher.Text<br />
strDateTime = tbDateTime.Text<br />
<br />
If cmboSelection.Text = "Network Location" Then<br />
<br />
Dim SMB As New SMBRepository<br />
<br />
With SMB<br />
strIntialFolder = strPathSMB + "\" + SMB.AddXMLDeclaration().attributes(0).text + "\"<br />
.CreateDirectory(strIntialFolder)<br />
.CreateFolderStructure(SMB.AddXMLDeclaration(), strIntialFolder, objRepository)<br />
.TransferDocumentIndex()<br />
End With<br />
<br />
ElseIf cmboSelection.Text = "FTP Transfer" Then<br />
<br />
Dim FTP As New FTPRepository<br />
<br />
With FTP<br />
strIntialFolder = FTP.AddXMLDeclaration().attributes(0).text<br />
.Connect()<br />
.CreateFolderStructure(FTP.AddXMLDeclaration(), strIntialFolder, objRepository) '<--- This is where the upload occurs<br />
.TransferDocumentIndex()<br />
.CloseConnection()<br />
End With<br />
<br />
End If<br />
<br />
For dblCount = 1 To 0 Step -0.05<br />
Me.Opacity = System.Math.Abs(dblCount)<br />
Next dblCount<br />
<br />
MsgBox("Folder Successfully Published", MsgBoxStyle.OKOnly)<br />
<br />
Progress.Hide()<br />
<br />
Me.Hide()<br />
<br />
''''''''''''END MY CODE'''''''''''''''<br />
<br />
System.Threading.Thread.Sleep(100)<br />
If callback.IsAborting Then<br />
Return<br />
End If<br />
<br />
'i = i + 1 <--- increments here<br />
End While<br />
Catch generatedExceptionVariable0 As System.Threading.ThreadAbortException<br />
Catch generatedExceptionVariable1 As System.Threading.ThreadInterruptedException<br />
Finally<br />
If Not (callback Is Nothing) Then<br />
callback.End()<br />
End If<br />
End Try<br />
<br />
End Sub<br />
Any help would be appreciated
thanks for your Time
Chris
|
|
|
|
|
Hello all
I hv a xml file, structure below.
Now i want to retrieve, a specific user node, suppose i want to know all values of "Sumit" user. Is there any solution. Can we write some query in xml?Thanks
<USERS>
<User>
<Username>Ankur</Username>
<Password>Ankur</Password>
<Status>y</Status>
</User>
<User>
<Username>Ahuja</Username>
<Password>Ahuja</Password>
<Status>n</Status>
</User>
<User>
<Username>Nitin</Username>
<Password>Nitin</Password>
<Status>n</Status>
</User>
<User>
<Username>Sumit</Username>
<Password>Sumit</Password>
<Status>y</Status>
</User>
</USERS>
Sumit Domyan
Software Developer
<b>ANALEC INFOTECH
|
|
|
|
|
This is possible using XPATH, a good article can be found here[^]
Hope this helps
Chris
|
|
|
|
|
The scenario is our sales or marketing or content management people should be able to build whatever reports they want on line.
Basically I have to put something like the Crystal Report Design Wizard where you can select tables, columns then formating etc on our admin site to allow them to create their own reports.
How could I archieve this?
As far as I know, using Crystal report, I create reports and deploy them which then users can view which doesn't meet my need. As this is not flexible enough for us (although I know that in a report you can add drilldown and a lot of functions).
Any ideas?
|
|
|
|
|
Hi guys,
Now I have to write a program, that call an external app, that must run in a windows form of my program. For example, I call the Calculator or Paint and it will show only on a form of my program (such as frmMain).
By the way, I want to know that how to touch a event of mouse click of system when my app not actived.
I want to ask if anyone can help me. Thank you.
|
|
|
|
|
Could you help me, I really need
|
|
|
|
|
nobita3x wrote:
that call an external app, that must run in a windows form of my program. For example, I call the Calculator or Paint and it will show only on a form of my program (such as frmMain).
Without going through A LOT of pain, you can't do this. You can't redirect the drawing output of an application to a window in your application. I have seems an example of this being done (can't remember where at the moment), but it required writing a new driver to support it.
nobita3x wrote:
I want to know that how to touch a event of mouse click of system when my app not actived.
What??????????????????? I can't make any sense out of this...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I say it is possible but the way to do it is not a good programming practice.
You can use the SetParent(ChildWhnd, NewParentHnd) API function to bring the calculator (or any other form) to your program like one of the forms of your application.
It's quite simple.
(If you need more help, let me know and I'll write the code for you some later time, cos now I'm in time shortage)
But for getting mouse and keyboard events when your app is not active, you should set a Global Hook.
It must be in a DLL file, etc.
Handling this is not good for security reasons. also it is rather not easy.
(For more information, search for Global Hook, and find availble dlls on the net)
Hope it'd helped.
|
|
|
|
|
Thank you for your answer. I have tried to write code use SetParent(ChildWhnd, NewParentHnd) API function, but I failed. Could you help me to write a example code. Thank you very much.
|
|
|
|
|
Create an MDIChild Form (called mdiForm1) and set it's border to nothing.
using the GetWindowRect API find the size of the calculator window and resize the form to that size.
Now call the following sub:
<br />
Sub ChangeParent()<br />
dim hndl as long = FindWindow("SciCalc", "Calculator")<br />
setparent(hndl, mdiForm1.hwndl)<br />
End Sub <br />
(In fact I don't have access to VB now -in my university- to check wether the code works correctly or not. Please tell me if it works.)
hope it had been helpful.
Mohammad
|
|
|
|
|
Thank you very much. But I have a problem. If I build a app with startup is Form1, then that app will showed in the form if I use the SetParent; but if I use Sub Main to startup and call Form1 by method Form1.ShowDialod(), then that app not showed in the form when I call SetParent(). Form1 not is a MDI type. I know that have to use the SetWindowLong() to set app's window style, but I don't know which bit (WS_POPUP, WS_CHILD, etc.) is need to set. Could you tell me? Again, Thank you.
|
|
|
|
|
This only works if the target window is an MDIChild window, not an MDIParent or main application window.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi i m trying to import a class to check internet history on local machine in vb.net. with below code...
<ComImport(), Guid("3C374A40-BAE4-11CF-BF7D-00AA006946EE")> _
Public Class UrlHistory
End Class
but some how its giving me error of System.TypeLoadException.
but when i tried in C# its working fine. without any errors. can any one help me in this matter.
C# code ...
[ComImport]
[Guid("3C374A40-BAE4-11CF-BF7D-00AA006946EE")]
public class UrlHistoryClass
{}
i m new to .Net tech.
Thanks in advance for yr help.
|
|
|
|
|
Hi,
I need to be able to Print an Escape sequence to a printer. When I print the escape from DOS the escape sequence is sent to the printer. But from my VB.net application it doesn't work. Any way to just print without setting fonts or dealing with the printer drivers ?
Thanks
|
|
|
|
|
|
Does anybody know if it is possible to display the contents of a TextBox in one form while typing it into another?
Example:
While typing in frm1, txt1 I would like the text to be displayed in frm2 txt2. Both forms will be open.
Thanks.
Brad
|
|
|
|
|
the way i know is ..
1- Declare the form you want the text to be viewed on in this form ..
Dim Frm2 as New Form2
then in the "On key press" Action of the textbox you type in .. let the text value of the textbox you want to show the text on .. in the new form ( Frm2 ) = the text value of the textbox that you are typing in ..
Frm2.TextBox1.text=TextBox1.text ..
i hope this works with you ..
لا اله الا الله محمد رسول الله
|
|
|
|
|
I thought that would/should work also but I haven't had any luck...
I'm going to keep playing around with it and see if I'm just forgetting to do something.
Thanks
Brad
|
|
|
|
|
What i would do is first creat a public variable in a module. Something like
public a as string. then on form1 after they click whatever button needed to get to form to do this.
a=texbox1.text
then on the form2 load procedure do
textbox2.text = a
hope this is what you are talking about and hope it helps if you have any questions about the above code feel free to email me at iamydd@bellsouth.net
|
|
|
|