|
I need extract audio in mp3 format from video files (avi or mpeg).
How can i do this ?
Thanks
|
|
|
|
|
Can anyone help.
I am trying to create an SQL statment and in the WHERE clause the text being searched for has a ' in.
For example
"SELECT * FROM [computer list table] WHERE [Computer Owner] = Damian's computer"
The problem i am having is with the Damian's Computer. It seems to get upset with the '
Any help would be much appreciated
|
|
|
|
|
Use 2 '' instead...
"SELECT * FROM [computer list table] WHERE [Computer Owner] = Damian''s computer"
Free your mind...
|
|
|
|
|
I usually creates a function PadApostrophe(strText as string) which will replace every single instance of ' with '' (two single quotes).
But recently I read this is not a very good way to do it, so if you're using SQL command object you can pass parameters instead and you don't need to replace the '.
Hope this helps!
|
|
|
|
|
|
Here is what I do.
I create a constant called QUOTES as below.
Const QUOTES = """"
I then create a function called SQLstring as below.
Public Function SQLstring(StringIn as String)as String
SQLstring = QUOTES & StringIn & QUOTES
End Function
So now if I want write an SQL statement that needs a string within a string, I do the following:
Dim SQL as String
Dim State as String
State = "CA"
SQL = "SELECT * FROM Table WHERE State = " & SQLstring(State)
The resulting SQL will be as follows:
SELECT * FROM Table WHERE State = "CA"
Is this what you are looking for?
|
|
|
|
|
I'm working on a vb app that I would like to connect to an ftp server and execute a few predefined commands. Basically what I'm looking to do is connect daily and d/l a file. I couldn't find anything in the codebank for vb.net, so I'm asking here.
Also, I'll be adding a feature that connects to a telnet server and executes a set a predefined commands as well, I would think the solution to the first problem will also solve this one.
I've read through my books but can't seem to figure out what to use to do what I want. Any help is appreciated.
Thanks.
|
|
|
|
|
For the FTP portion - check out the article and code by Alex Kwok
I reference his C# component in my VB app and use it regularly. I've had to make a few changes to account for odd directory listings but even though I'm not a C# programmer I had no problems with it.
|
|
|
|
|
Hi,
Im trying to write an app to do this but im not sure were to start. I need some pointer on:
Opening and reading binary file
moveing to specific part in the file so i can extract the data.
Cheers
Lukey
|
|
|
|
|
|
Hi,
I want to create an application, which constantly listen to the traffic on a Windows 2000 server. The purpose is to monitor 8 of the computers on the network to control the time users spend on the network via these machines.
The purpose is that the students (it is on a school) can use these 8 machines very much like computers in an Internet cafe. The students should be granted 15 minutes each within a 2 hour period. After the 2 hours they get another 15 minutes available. The 15 minutes time slot should be flexible, as the user should be able to choose when or whether he/she wants to use it.
I have never created such an application before, or even touched the subject, as my programming experience is quite limited.
Can someone please give me some hints on how this can be done. Or even better, submit some source code, which can perform such a task.
My initial idea is that I can create an application that constantly monitor the traffic from these 8 computers using their IP or MAC address to identify them, and make a simple log using Access. If a user tries to log on and their given time slot has been used, the application just blocks any traffic to that computer until a legitimate user logs on.
Is this the way to go?
I'll be happy for any comments...!!!
Thanks in advance,
N.
|
|
|
|
|
I'm writing an app that opens an image file, converts it to a gif, sets it transparency and then resizes it. Everything works fine until I resize the image (The transparency is lost and is replaced with black pixels). The reason is that to resize the image I am doing a matrix transform and drawing the image onto a new image. When it draws onto the new image it loses its transparency information (I think this is because the image I am getting does not have the right colour depth). I could apply the transparency after resizing but this leaves 'fuzzy edges'. Does anybody have any ideas how I could achieve drawing an image with transparent areas onto a new image.
If anyone can help that would be great, I could mail the entire code if necessary, would have posted it here but its too long.
Here is a small section the code:
<br />
Private Sub ResizeImage(ByVal filename As String, ByVal Width As Integer, ByVal height As Integer)<br />
Dim oSourceImage As Bitmap<br />
Dim tmpBmp As Bitmap = CType(Image.FromFile(filename), Bitmap)<br />
Dim IsAlpha As Boolean = Image.IsAlphaPixelFormat(tmpBmp.PixelFormat)<br />
If IsAlpha = False Then<br />
oSourceImage = New Bitmap(tmpBmp.Width, tmpBmp.Height, PixelFormat.Format32bppArgb)<br />
Dim g As Graphics = Graphics.FromImage(oSourceImage)<br />
g.DrawImage(tmpBmp, 0, 0)<br />
g.Dispose()<br />
tmpBmp.Dispose()<br />
Else<br />
oSourceImage = tmpBmp<br />
End If<br />
<br />
'Dim oSourceImage As Image = TransImageUtility.SetTransparentColour(Image.FromFile(filename))<br />
If Not ((oSourceImage.Width <= Width) And (oSourceImage.Height <= height)) Then<br />
Dim oResizedImage As New Bitmap(Width, height, PixelFormat.Format32bppArgb)<br />
Dim oGraphic As Graphics = Graphics.FromImage(oResizedImage)<br />
oGraphic.CompositingQuality = CompositingQuality.HighQuality<br />
oGraphic.SmoothingMode = SmoothingMode.HighQuality<br />
oGraphic.InterpolationMode = InterpolationMode.HighQualityBicubic<br />
Dim oRectangle As New Rectangle(0, 0, Width, height)<br />
'********************************<br />
Dim largestRatio As Double = Math.Max(CDbl(oSourceImage.Width) / Width, CDbl(oSourceImage.Height) / height)<br />
Dim posX As Single = CSng(Width * largestRatio / 2 - oSourceImage.Width / 2)<br />
Dim posY As Single = CSng(height * largestRatio / 2 - oSourceImage.Height / 2)<br />
Dim mx As New Matrix(1.0F / CSng(largestRatio), 0, 0, 1.0F / CSng(largestRatio), 0, 0)<br />
mx.Translate(posX, posY)<br />
oGraphic.Transform = mx<br />
oGraphic.DrawImageUnscaled(oSourceImage, 0, 0)<br />
'********************************<br />
oSourceImage.Dispose()<br />
oResizedImage.Save(filename, ImageFormat.Gif)<br />
End If<br />
End Sub
Jim
|
|
|
|
|
I can think of two ways. Either you could handle the controls' GetFocus event, and keep track of which control has the focus using a member variable. Alternatively, you could iterate through the form's Controls collection and call Paste on the control whose Focused property is True .
The first option requires a little overhead when the focus is changed; the second requires a bit more overhead when the Paste function is used. If you don't have many controls on the form, the latter is probably a better solution.
|
|
|
|
|
Hi Mike
Thanks for your comments.
Yeah, I have tried the second way, but it didn't work to well.
It just pasted the text to all the textboxes.
I did consider doing it the first way as well, but thought that there must be an easier way of implementing it.
I'll give it another go when I get in.
Cheers,
Dan
|
|
|
|
|
I'm trying to learn and have a problem selecting an author from the combo box and pulling up that particular authors book info in a datagrid.
Can someone please help on the Selected Index changed to pull up info in
data grid. I can't bind them together.
Would appreciate so much!!!!!!!!!!!!!!!!! Alex
Below is code:
'Call up authors name in combo box
cmdAuthors.CommandText = "Select au_id, au_fname + ' ' + au_lname as name From authors"
cmdAuthors.CommandType = CommandType.Text
cmdAuthors.Connection = conPubs
conPubs.Open()
'cboAuthors.DataTextField = paraName.Value
daAuthors.Fill(dsPubs, "Authors")
conPubs.Close()
'show the names in the combo box
cboAuthors.DataSource = dsPubs.Tables("Authors")
cboAuthors.DataTextField = "name"
cboAuthors.DataValueField = "au_id"
cboAuthors.DataBind()
End Sub
Private Sub cboAuthors_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboAuthors.SelectedIndexChanged
Dim conPubs As New SqlConnection("Server=alex; Database= pubs; UID= sa; PWD= ")
Dim cmdTitles As New SqlCommand
Dim drTitles As SqlDataReader
Dim daTitles As New SqlDataAdapter(cmdTitles)
Dim dsPubs_Titles As New DataSet
cmdTitles.CommandText = "Select title, title_ID, pub_id, pubdate From Titles Where authors.au_id = titles.title_id ORDER BY titles.title"
cmdTitles.CommandType = CommandType.Text
cmdTitles.Connection = conPubs
If Not IsPostBack Then
conPubs.Open()
End If
dgTitles.DataSource = dsPubs_Titles
drTitles = cmdTitles.ExecuteReader
dgTitles.DataSource = drTitles
dgTitles.DataBind()
daTitles.Fill(dsPubs_Titles, "Titles")
conPubs.Close()
End Sub
End Class
|
|
|
|
|
how to shutdown windows from vb .net application thx
|
|
|
|
|
I am trying to parse the quotation marks from a string that is returned from an inputbox and then "shell" to the console.
Here is my code.
Dim FileName As String = InputBox("Please enter the file name here")
Shell("c:\program files\d-tools\daemon.exe" & " -unmount 0 ")
Shell("c:\program files\d-tools\daemon.exe" & " -mount 0," & FileName)
End Sub
Just to clarify this is a console app.
Any help would be great!
Thank
I'm just a simple man with complex issues.
|
|
|
|
|
I'm not sure what your looking for. What do you mean by parse? What is the end result supposed to look like?
<br />
Dim FileName As String = InputBox("Please enter the file name here")<br />
Shell("c:\program files\d-tools\daemon.exe" & " -unmount 0 ")<br />
Shell("c:\program files\d-tools\daemon.exe" & " -mount 0," & FileName)<br />
The InputBox looks OK. If the user types (WITH quotes): "C:\Program Files\Stuff.txt", that exact string will be passed in the Shell statement. The 2nd shell command will look exactly like this:
<br />
c:\program files\d-tools\daemon.exe -mount 0,"C:\Program Files\Stuff.txt"<br />
If that's what you want passed to the Shell, then you don't have any problems...
BTW: What's with the '&' your using right after the daemon.exe? You don't need it there. Just to make the code a little more readable, you might want to take those out, but keep the one in front of 'FileName'.
RageInTheMachine9532
|
|
|
|
|
My dumb mistake I was trying to mount the image without having the user type in the location.
Thanks
RageInTheMachine9532 wrote:
BTW: What's with the '&' your using right after the daemon.exe? You don't need it there. Just to make the code a little more readable, you might want to take those out, but keep the one in front of 'FileName'.
In VB.Net it requires some sort of connector when writting a string. If you just type:
shell("c:\program files\d-tools\daemon.exe" "-unmount 0")
it will error out at "-unmount 0"
Therefore I put the "&" sign in.
|
|
|
|
|
Rip V. Winkle wrote:
In VB.Net it requires some sort of connector when writting a string. If you just type:
shell("c:\program files\d-tools\daemon.exe" "-unmount 0")
it will error out at "-unmount 0"
OK. Why are you using two strings? Why not just use the one:
<br />
shell("c:\program files\d-tools\daemon.exe -unmount 0")<br />
RageInTheMachine9532
|
|
|
|
|
RageInTheMachine9532 wrote:
OK. Why are you using two strings? Why not just use the one:
shell("c:\program files\d-tools\daemon.exe -unmount 0")
My bad that was the way I had to do it in my batch file
My head is NOT screwed on right.
|
|
|
|
|
Any help - would be appreciated on reverse engg of some OCX files I have here
is it possible on VB6 -- ocxs created
tx
|
|
|
|
|
Hmm. Let me see now; an anonymous request for help reverse-engineering an OCX....
Think I'll just sit and watch who bites first...
Steve S
|
|
|
|
|
|
Hi..Am Heba
Am new in usin VB.I have a little start in usin VB to creat a Data Base and little tasks..but i need ur help in a matter i didnt find it till now..how can i make a splash screen usin VB 6..plz reply fast ..thx alot
nona20041980@hotmail.com
اذكر الله حيثما كنت
واتبع السيئه الحسنه تمحها
وخالق الناس بخلق حسن
|
|
|
|