|
hi all,
i now facing the problem to convert the hexadecimal to decimal. anybody knowing it? the following are the example:-
Text1.Text = Hex(Int(PrintTAZC(1)))
Text2.Text = Hex(Int(PrintTAZC(2)))
Text3.Text = Text1.Text + Text2.Text
Text4.Text =
The Text4 textbox will display the result of the convertion in decimal of the Text3.Text. Text3.Text is in hexadecimal form.
|
|
|
|
|
Your question is a little vague. Are your trying to add two numbers or is TextBox3 support to have TextBox2 appended to TextBox1, the result showing in Hex in TextBox3 and the Decimal verison in TextBox4?
The code as you posted will append, not add!, TextBox2 to TextBox1 and show the result in TextBox3. The code to convert that result to Decimal and show it in TextBox4 is easy enough:
Text1.Text = Hex(Int(PrintTAZC(1)))
Text2.Text = Hex(Int(PrintTAZC(2)))
Text3.Text = Text1.Text + Text2.Text
Text4.Text = Val( "&H" & Text3.Text )
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for ur help. I oledi try it by using ur example in my program, it are success to running. Thanks a lot...........
|
|
|
|
|
Dear Sir/Madam,
I have developed on vb app and I would like to run it as a windows service. I used srvany.exe to make it as service. when I make it as a service and try to start the service it is giving message like "windows is started your service but windows stop your service automatically if there is no use of this servic."
|
|
|
|
|
Your going to have to supply the EXACT error message. Just guessing at what it said can be very misleading.
Is your app a Windows Forms app? Does it expect to get user input? Is your service setup under the Local System account and is it set for "Allow interaction with the desktop"?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dear Dave,
I have made the Vb application in Standerd EXE project type. and make it as service by SRVANY.exe wizards.
The exact message which I am getting while I starts the service is
"The MyClient service of local computer started and stopped Some services stop automatically if they have no work to do for example, The performance log and Alert service"
The MyClient is my service name. My VB application is a Vb form app with standerd exe. and it is a form which is axpect to get two input from user as user id and password.
service setup under the Local System account and it is not set for "Allow interaction with the desktop
my application was already running in windows startup.
but when i make it as a service its not coming in startup.
Thanks
Patel Murtuza.
|
|
|
|
|
Dear Dave,
I have made the Vb application in Standerd EXE project type. and I make it as service by SRVANY.exe wizards.
The exact message which I am getting while I starts the service is
"The MyClient service of local computer started and stopped Some services stop automatically if they have no work to do for example, The performance log and Alert service"
The MyClient is my service name. My VB application is a Vb form app with standerd exe. and it is a form which is axpect to get two input from user as user id and password.
service setup under the Local System account and it is not set for "Allow interaction with the desktop
my application was already running in windows startup.
but when i make it as a service its not coming in startup.
Thanks
Patel Murtuza.
|
|
|
|
|
patelmurtuza wrote:
and it is not set for "Allow interaction with the desktop
Since your putting up a form that asks for user input when the "service" starts, you have two problems that will stop you dead in your tracks.
First, is the above quote. This should be a big clue. Without "allow interaction with desktop", you're never going to see your form since the services don't get a desktop. This is what is making your app quit immediately on startup.
Second, your app can't put up a form if there is no user logged in. Your service must be able to handle the service control managers window messages that say when a user is logging on, when the user logs off, when Windows starts and stops...
Your app can't handle these messages because it's a VB app that doesn't expose its message handler to you to override. VB.NET does do this. Once your app starts, normally, you MUST call the Win32 API function RegisterServiceControlHandlerEx with the pointer to another function, that you write, called HandlerEx . This function will receive the messages that notify you when a user if logging on and off and the normal service control messages like, stop, pause, resume. Even if you call this function, you still have the problem where your app must be running code in a loop to keep the app alive so the HandlerEx function does get killed.
SRVANY can't make ANY app a service. Especially ones that require user interaction!
Avoid the headaches with doing this and write the thing in VB.NET, which supports writing services natively. VB6 doesn't and is not a good choice for it at all.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I need my application to scan my harddrive folder by folder for files of type [whatever] and write the results to a file in the app directory.
Can anyone help me with this? Thanks.
[edit]
Yeah, yeah. Someone voted this post down as noise. Whatever. I'm just asking a simple question as I'm in the process of figuring out the answer on my own. I was just kind of hoping that someone had thirty seconds to point me towards something that could help me in my search.
Not everyone is an expert. I know I'm not, and I thought this website was meant to help people who didn't necessarily know everything. Sorry for wasting the time it took you to vote this post as noise in your opinion.
"Go to, I’ll no more on’t; it hath made me mad." - Hamlet
|
|
|
|
|
This sample checks the .Doc files and copy them to 1.txt file
Refer this for your problem
private ArrayList files = new ArrayList(); // ArrayList to store files
private void button1_Click(object sender, System.EventArgs e)
{
string path = @"C:\";
string ext = ".doc";
System.IO.DirectoryInfo dirInfo = new System.IO.DirectoryInfo(path);
LoopDirectory(dirInfo, ext);
// Save files
using(System.IO.StreamWriter sw = new System.IO.StreamWriter(@"C:\1.txt"))
{
foreach(string file in files)
sw.WriteLine(file);
sw.Close();
}
}
// Loop files
private void LoopDirectory(System.IO.DirectoryInfo dirInfo, string extension)
{
foreach(System.IO.FileInfo file in dirInfo.GetFiles())
{
if(file.Extension.ToLower() == extension.ToLower() )
files.Add(file.FullName);
}
foreach(System.IO.DirectoryInfo dir in dirInfo.GetDirectories())
LoopDirectory(dir, extension);
}
}
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
Thanks for your help. I appreciated it a lot.
This is a VB forum though, and I was hoping to see the answer in VB code.
Let me know if you can help. Thanks.
"Go to, I’ll no more on’t; it hath made me mad." - Hamlet
|
|
|
|
|
My mistake, check code in VB.NET
Dim files As New ArrayList
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim path As String
Dim ext As String
path = "C:\Documents and Settings"
ext = ".doc"
Dim dirInfo As New System.IO.DirectoryInfo(path)
LoopDirectory(dirInfo, ext)
Dim sw As New System.IO.StreamWriter("C:\1.txt")
For Each file As String In files
sw.WriteLine(file)
Next
sw.Close()
End Sub
Private Sub LoopDirectory(ByVal dirInfo As System.IO.DirectoryInfo, ByVal extension As String)
For Each file As System.IO.FileInfo In dirInfo.GetFiles()
If (file.Extension.ToLower() = extension.ToLower()) Then
files.Add(file.FullName)
End If
Next
For Each dir As System.IO.DirectoryInfo In dirInfo.GetDirectories()
LoopDirectory(dir, extension)
Next
End Sub
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
This might get you started.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' make a reference to a directory
Dim dirInfo As New IO.DirectoryInfo("c:\")
Dim dirArg As IO.FileInfo() = dirInfo.GetFiles(".whatever")
Dim dirFileInfo As IO.FileInfo
'list the names of all files in the specified directory
For Each dirFileInfo In dirArg
ListBox1.Items.Add(dirFileInfo)
Next
End Sub
|
|
|
|
|
Is this VB.net code? I only have VB 6. I'll see if I can adapt it.
Thanks for your help.
"Go to, I’ll no more on’t; it hath made me mad." - Hamlet
|
|
|
|
|
I was working on a basic tut to make a guessing game. The prog picks a random number from 1 to 10 and you have to try to guess it. It tells you if you guess too high or low or guess correctly. I want to add a reset button to start the form over and run the random number genreator again. I want to be able to play again without closing and relaunching the .exe file. Can anyone give me any idea of how to do this?
Thanks,
Glisson
|
|
|
|
|
Add 2 labels, 2 buttons and one textbox
private System.Windows.Forms.Button btnCheck;
private System.Windows.Forms.TextBox txtGuess;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnReset;
private System.Windows.Forms.Label lblMessage;
WRITE THIS CODE IN EVENTS:
private int randomNumber = 0;
private void btnReset_Click(object sender, System.EventArgs e)
{
GenerateRandomNumber();
}
private void Form1_Load(object sender, System.EventArgs e)
{
GenerateRandomNumber();
}
private void GenerateRandomNumber()
{
this.txtGuess.Text = String.Empty;
this.lblMessage.Text = String.Empty;
Random rand = new Random();
// Generate a random number between specific intervals (1 and 10.)
this.randomNumber = rand.Next( 1, 10 );
}
private void button1_Click(object sender, System.EventArgs e)
{
try
{
string data = txtGuess.Text.Trim();
if(data == string.Empty) return;
int number = Convert.ToInt32(data);
if(this.randomNumber == number)
this.lblMessage.Text = "Correct";
else if(this.randomNumber > number)
this.lblMessage.Text = "Low";
if(this.randomNumber < number)
this.lblMessage.Text = "High";
}
catch{}
}
}
}
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
Hi,
I'm wanting to track the clicks a user takes through a menu in a Pocket PC VB.net App (.net compact framework)
Clicks are not registering when a user clicks a sub menu?
Does anybody know how to call the 'Popup' event when a user click on a sub menu?
Thanks in advance.
|
|
|
|
|
Your question would be better handled in the Embedded/Mobile forum, here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can i protect my application using the computer's registry files ??
Thnx
|
|
|
|
|
"Protect"?? - you can't. It's such an easy method to get around it's not worth the effort. Check into professional security package. Just Google for "developer application copy protection".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I am trying to compact and repair an access 2000 d/b from within vb.net using this code from microsoft:
Dim jro As JRO.JetEngine<br />
<br />
jro = New JRO.JetEngine()<br />
<br />
jro.CompactDatabase("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\nwind.mdb", _<br />
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\NewNwind.mdb;Jet OLEDB:Engine Type=5")<br />
<br />
MsgBox("Finished Compacting Database!")
The problem is that when I try to replace the both the source and the destination file with application.startupath and my file name, vb.net breaks at the MsgBox line saying the the file is not found.
I have to use application.startupath in order for my app to find the database upon deployment.
I think the problem is that I do not knmow how to use application.startupath in this instance.
Any help?
|
|
|
|
|
SourceDB = Application.StartupPath & "\yourDataBase.mdb"
BackupDB = Application.StartupPath & "\yourDataBase.mdb.bak"
jro.CompactDatabase("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SourceDB, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & BackupDB & ";Jet OLEDB:Engine Type=5")
|
|
|
|
|
The more correct way would be to use the Combine static method of the Path class to combine the filename and StartupPath.
Imports System.IO
.
.
SourceDB = Path.Combine(Application.StartupPath, "yourDataBase.mdb")
BackupDB = Path.Combine(Application.StartupPath, "yourDataBase.mdb.bak")
jro.CompactDatabase("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SourceDB, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & BackupDB & ";Jet OLEDB:Engine Type=5")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I'm trying to build a little MP3 player application in VB 6. I need some sort of reference on the properties and methods of the Windows Media Player 9 ocx control. wmp.dll
If anyone could help me out I'd appreciate it. Thanks.
"Go to, I’ll no more on’t; it hath made me mad." - Hamlet
|
|
|
|