|
I was talking about Windows Application. There is no way (as far as I know) where you can interactively display Word document on a web page.
You may try to convert the Word doc into html format and display it in an iFrame.
|
|
|
|
|
hello to everyone.. i want to ask how to do this code in vb.net.. becuase i am newly in the vb.net .. i only got correctly in vb6.. there are some differences but i think their almost the same.. can you help me guys to do my program..?? my problem is that i cant generate the voice... it gives me error but in vb6 its working properly.. i am using now vb.net and sapi 5.1.. my OS windows XP.. this is like an ordering application..
here's my code...
Public Class main<br />
<br />
Public gmode As Integer<br />
Public gRestoreGrammar As Boolean<br />
Public additional As Boolean<br />
<br />
Private Sub AxDirectSR1_PhraseFinish(ByVal flags As Long, ByVal beginhi As Long, ByVal beginlo As Long, ByVal endhi As Long, ByVal endlo As Long, ByVal Phrase As String, ByVal parsed As String, ByVal results As Long)<br />
If (parsed = "") Then<br />
AxDirectSR1.Deactivate()<br />
If (Rnd() > 0.5) Then<br />
AxDirectSS1.Speak("kindly repeat your order again sir.")<br />
Else<br />
AxDirectSS1.Speak("please follow the menu.")<br />
End If<br />
Else<br />
If (parsed = "ok") Then<br />
AxDirectSR1.Deactivate()<br />
If (additional = False) Then<br />
gmode = 2<br />
AxDirectSS1.Speak("Would like to have drinks?")<br />
<br />
Else<br />
gmode = 3<br />
AxDirectSS1.Speak("would that be all sir?")<br />
End If<br />
ElseIf (parsed = "cancel") Then<br />
Dim Item As String<br />
Item = ListBox1.Items.Count - 1<br />
If (Item >= 0) Then<br />
ListBox1.Items.Remove(ListBox1.Items.Count - 1)<br />
AxDirectSR1.Deactivate()<br />
AxDirectSS1.Speak("your order cancel")<br />
End If<br />
ElseIf (parsed = "no") Then<br />
If (gmode = 2) Then<br />
gmode = 3<br />
additional = True<br />
AxDirectSR1.Deactivate()<br />
AxDirectSS1.Speak("verifying your order")<br />
ElseIf (gmode = 3) Then<br />
gmode = 0<br />
gRestoreGrammar = True<br />
AxDirectSR1.Deactivate()<br />
AxDirectSS1.Speak("you can continue your order")<br />
Else<br />
gmode = 0<br />
gRestoreGrammar = True<br />
End If<br />
ElseIf (parsed = "yes") Then<br />
<br />
If (gmode = 2) Then<br />
'form2.Show()<br />
gmode = 3<br />
AxDirectSR1.Deactivate()<br />
AxDirectSS1.Speak("would that be all")<br />
<br />
ElseIf (gmode = 3) Then<br />
Dim total As Integer<br />
total = 0<br />
For i = 0 To ListBox1.Items.Count - 1<br />
total = total + Val(ListBox1.Items(i))<br />
Next i<br />
ListBox1.Items.Add("---total is: $" + Format(total, "###0.00"))<br />
gmode = 1<br />
gRestoreGrammar = True<br />
<br />
AxDirectSR1.Deactivate()<br />
<br />
AxDirectSS1.Speak("Your total will be $" + Format(total, "###0.00") + " at the next window please.")<br />
End If<br />
Else<br />
AxDirectSR1.Deactivate()<br />
ListBox1.Items.Add(parsed)<br />
End If<br />
End If<br />
<br />
ListBox1.SelectedIndex = ListBox1.Items.Count - 1<br />
AxDirectSS1.Speak(Phrase)<br />
<br />
End Sub<br />
Private Sub DirectSS1_AudioStop(ByVal hi As Long, ByVal lo As Long)<br />
If (gmode = 1) Then<br />
ListBox1.Items.Clear()<br />
gmode = 0<br />
AxDirectSS1.Speak("Hi! May I take your order?")<br />
Else<br />
If (gmode = 2) Or (gmode = 3) Then<br />
<br />
AxDirectSR1.GrammarFromFile("C:\Documents and Settings\kaex21\My Documents\Visual Studio 2008\Projects\Project1\WindowsApplication6\WindowsApplication6\yesno.txt")<br />
<br />
ElseIf (gRestoreGrammar) Then<br />
<br />
AxDirectSR1.GrammarFromFile("C:\Documents and Settings\kaex21\My Documents\Visual Studio 2008\Projects\Project1\WindowsApplication6\WindowsApplication6\menu.txt")<br />
gRestoreGrammar = False<br />
<br />
End If<br />
REM we had to turn off listening before talking, so now that we are done talking we<br />
REM should start listening again<br />
AxDirectSR1.Activate()<br />
End If<br />
End Sub<br />
<br />
Private Sub main_Terminate()<br />
AxDirectSR1.Deactivate()<br />
End Sub<br />
<br />
<br />
<br />
Private Sub LinkLabel2_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked<br />
Form5.Show()<br />
Visible = False<br />
<br />
End Sub<br />
<br />
Private Sub Label9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label9.Click<br />
<br />
End Sub<br />
<br />
Private Sub GroupBox18_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox18.Enter<br />
<br />
End Sub<br />
<br />
Private Sub LinkLabel3_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel3.LinkClicked<br />
End<br />
End Sub<br />
<br />
<br />
Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
gmode = 0<br />
gRestoreGrammar = False<br />
<br />
On Error GoTo GeneralFail<br />
REM we just use this function once, on the first callback, then the timer isn't needed anymore<br />
Dim engine<br />
REM Initialize the recognizer. We want command and control, so find and select that engine (or best match)<br />
AxDirectSR1.Initialized = 1<br />
<br />
engine = AxDirectSR1.Find("MfgName=Microsoft;Grammars=1")<br />
AxDirectSR1.Select(engine)<br />
<br />
REM Burger.txt is our uncompiled grammar. Compile and load it now.<br />
AxDirectSR1.GrammarFromFile("C:\Documents and Settings\kaex21\My Documents\Visual Studio 2008\Projects\Project1\WindowsApplication6\WindowsApplication6\menu.txt")<br />
REM Now load the synthesizer, find and select any female voice from microsoft<br />
AxDirectSS1.Select(AxDirectSS1.Find("MfgName=Microsoft;Gender=1"))<br />
<br />
REM Start the voice interface...control goes to DirectSS1_AudioStop after this is said, gMode=0<br />
AxDirectSS1.Speak("Welcome to kaex restaurant, sit back and enjoy as you take your order.")<br />
<br />
REM sometimes the vb environment comes to front while we're loading, so take the screen back<br />
Me.Show()<br />
GoTo done<br />
GeneralFail:<br />
MsgBox("Unable to start using text to speech or recognition.")<br />
done:<br />
<br />
End Sub<br />
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick<br />
<br />
End Sub<br />
<br />
End Class
|
|
|
|
|
Its quite difficult to write down the full code, but if you can tell us what error you are getting then we may help you.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
sorry for putting down all my codes..
here's the line of code which ive got error..
Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load <br />
gmode = 0<br />
gRestoreGrammar = False<br />
<br />
On Error GoTo GeneralFail<br />
<br />
REM Initialize the recognizer. We want command and control, so find and select that engine (or best match)<br />
AxDirectSR1.Initialized = 1<br />
dim engine as string<br />
engine = AxDirectSR1.Find("MfgName=Microsoft;Grammars=1")<br />
AxDirectSR1.Select(engine)<br />
<br />
REM menu.txt is our uncompiled grammar. Compile and load it now.<br />
<br />
AxDirectSR1.GrammarFromFile("C:\Documents and Settings\kaex21\My Documents\Visual Studio 2008\Projects\Project1\WindowsApplication6\WindowsApplication6\menu.txt")<br />
REM Now load the synthesizer, find and select any female voice from microsoft<br />
AxDirectSS1.Select(AxDirectSS1.Find("MfgName=Microsoft;Gender=1"))<br />
<br />
REM Start the voice interface...control goes to DirectSS1_AudioStop after this is said, gMode=0<br />
AxDirectSS1.Speak("Welcome to kaex restaurant, sit back and enjoy as you take your order.")<br />
<br />
REM sometimes the vb environment comes to front while we're loading, so take the screen back<br />
Me.Show()<br />
GoTo done<br />
GeneralFail:<br />
MsgBox("Unable to start using text to speech or recognition.")<br />
done:<br />
<br />
End Sub
it always say "unable to start using text to speech or recognition becuase it has an error.. and directly it go to generalfail.. it means i have an error above my codes.. can you help me sir how to correct this one?? in newly in vb.net.. this code that ive been working is fully functional in vb6.. but in vb.net is not..
|
|
|
|
|
It seems you are using a COM component to recognize speech. In that case, you have to add a reference to the COM component in VS and it will create a RCW for you. And then remove error handling from the procedure that is giving you the error, this will enable you to nail down to the exact line that is causing the error.
|
|
|
|
|
Error : Section or group name 'system.web.extensions' is already defined. Updates to this may only occur at the configuration level where it is defined.
I have a web application project which developed under 3.5 .net framework. Also there is a virtual directory under the project that developed in 2.0 .net framework. These two sections belongs to their web.config file.
Root Project’s config : <sectionGroup name="system.web.extensions" type= "System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
Virtual Directory’s config : <sectionGroup name="system.web.extensions" type= "System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
|
|
|
|
When ASP.NET reads configuration information it starts at the highest level, with machine.config, and works downward in the chain. The virtual directory is below the root and can't redefine this element, especially to a lower version. Remove it and it should work fine.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi all,
I try to create a client program on a mobile device which sends every 5 or 10 seconds a MySQL Query/Command to update the database with many of informations like Software version of each mobile device.
My question is: is it clever to this on this way or do I have to much traffic on network when 1000 clients sends at the same time a mysql query/command to a mysql server every 5 or 10 seconds the whole day?
The planing infrastructre of this solution is the following:
- I have one MySQL Server which contains information of all mobile devices
- I have a management console that query the MySQL server to get this information
- I have 1000 mobile devices that sends every 5 or 10 seconds their information like S/W version/Bootloader version etc. to the MySQL server
So can I make it this way or I'm on a wrong way?!
Thanks for your qnswers,...
Walter
|
|
|
|
|
nxexo007 wrote: I have 1000 mobile devices that sends every 5 or 10 seconds their information like S/W version/Bootloader version
Is this information really going to change every 5 to 10 secnds?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
First of all, thank you for your reply.
So, this information doesn't change every 5 to 10 seconds.
But the thing is, that I want to update the last online time of the mobile device,
so I can see that the unit is online now.
Every 5 or 10 seconds the unit will notify himself on the database.
The table will looks like this:
[S/N] [Devicename] [IP] [LastOnlineTime] [S/W-Version] and so on...
Then the management console will check the [LastOnlineTime] column and then I know when the device was last time online.
And every mobile device will do this (1000 units are in the network). In this way I can see how many devices are online now.
It's a kind of online notifyer for mobile devices.
My question is, can a MySQL server handle this and is that not to much traffic for the network?
Or is this solution a little bit sh*t.
|
|
|
|
|
I would think MySQL should be able to handle it. The question is more whether the network will support it and if your application can as well.
If all you need to know is if the device is online, then you don't need to transmit all the data you are asking for. A simple reply with the device ID would be enough.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
What do you mean with:
Mark Nischalke wrote: A simple reply with the device ID would be enough.
Is this a reply to the database or do you mean a reply over UDP to the management console?
|
|
|
|
|
It's your application, you determine where the reply should go.
You don't need to transmit everything about the device just to know it's online. Just transmitting the device ID, one piece of information, will be enough to know that its online right? Why send 50 bytes over the network when 2 bytes is enough?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hmm,
Ok thank you I will try it like you say.
But I need although the information like S/W version.
So, I can send a command over UDP to all units, so that the units will update their information to MySQL database. And this I do not always, I do this just from the management console when I want and not every 5 or 10 seconds.
Or I will made a pilot-test with 500 units in this network, to test the MySQL performance with my for solutions idea.
I don't know, I have to think about it...
|
|
|
|
|
Send all the information like S/W, bootloader version, etc. only ONCE and send a 'ping' to the database every 5 or 10 mins along with the Device ID. The date/time the ping was received will be the last online date/time of the device. MySQL is a solid database used worldwide for production purposes, and if properly configured, it can easily handle millions of transactions per second. So that should not be a problem.
|
|
|
|
|
Is there a library available that implements the entire Windows API (via System.Runtime.InteropServices )?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Not that I know of
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
if you mean one or a few classes that wrap the content of kernel32.dll and user32.dll and the like, the answer is no, unfortunately. I started such classes years ago, and each time I need another Win32 function, I add its prototype to them, but that is a never ending endeavor.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
That'll only happen when Microsoft rewrites the entire kernel in managed code.
|
|
|
|
|
Project in VS2008.Although i searched here for fixes, i didn't find anything of use.
I saw this http://www.codeproject.com/Forums/1650/NET-Framework.aspx?fid=1650&select=2572091&tid=2572091[^] solution, but i didn't try it because it in C, and i can't translate it to VB
Ok, there is an ACCESS DATABASE, where the user can store various information.
The database DOES have an autogenarated unique primary key.
When the user saves the record and then tries to delete right away THIS record, the "Concurrency violation: the DeleteCommand affected 0 of the expected 1 records." comes up.
However if the user reruns the program and tries to delete, everything is normal and work.
The problem is that when the user updates the database, for some reason the record does not get the normal primary key until you rerun the program.This much i know.What i dont't know, is how to fix this problem.Trying to refill the adapter after i update the record does not seem to correct it.
The code to update the database is this.
DataSet31.Tables(0).NewRow()
....
.... Part where the user fills in the information he wants to store in the database
....
....
DataSet31.Tables(0).Rows.Add()
OleDbDataAdapter3.Update(DataSet31.Tables(0))
DataSet31.Tables(0).AcceptChanges()
And the code to delete the record is this
DataSet31.Tables(0).Rows(rowindex).Delete()
OleDbDataAdapter3.Update(DataSet31.Tables(0)) <------ Here is when the problem occurs
DataSet31.Tables(0).AcceptChanges()
Thanks in advance.
modified on Saturday, November 7, 2009 4:22 AM
|
|
|
|
|
Well, some minutes later I seem to have solved the problem.
I actually ported the C, solution to VB and it solved.
Here is the solution.
On adapter rowupdated event add the following code.
Private Sub OleDbDataAdapter3_RowUpdated(ByVal sender As System.Object, ByVal e As System.Data.OleDb.OleDbRowUpdatedEventArgs) Handles OleDbDataAdapter3.RowUpdated
If (e.StatementType = StatementType.Insert) Then
Dim cmd As OleDbCommand = New OleDbCommand("SELECT @@IDENTITY", e.Command.Connection)
'If your ID field has different name than Id, replace the Id part on the next line, whith the correct
e.Row("Id") = cmd.ExecuteScalar()
e.Row.AcceptChanges()
End If
End Sub
Hope this helps
|
|
|
|
|
Hi to every one.
I am in a situation and finding the way to figure it out.
I have a web server hosting multiple web sites. Now i added some more web servers to same sub net mask. But these are not live servers. So now i want that when main server receives some requests for sites, it will transfer the request to other servers in the subnet. So that the complete bunch of requests is divided up to different servers and processed faster.
In short i want to implement a load balancing scenario. It is my own student research. No commercial work is included.
Please guide me through it. Should i implement some HTTPListener or i have write some ISAPI extension for IIS.
Thanks in advance.
|
|
|
|
|
i was able to send packets from my traffic generator to the pc, inorder for me to confirm the packets were sent i used wireshark as a visual aid. from there i saved the file as cvs and then paste data into excel sheet. once in this format i was able to do a stored procedures which put the data in a sql database. now i know there has to be a better way to both read and write captured packets to ANY database. any suggestions with steps
|
|
|
|
|
Instead of doing all that middle code (create a cvs file), why don't you buffer the records in memory and call a stored proc to add the data as it's received?
One thread plugs the data into the buffer, and one thread pulls it out and puts it in the database.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
ok imma give that a try thanks
|
|
|
|