|
You haven't created any array.
Dim buffer(4) As Byte
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi
Been looking for VB.Net example on midi files, but only seem to get C++ or C# stuff.
Can anyone point me to an example in VB.
I want to write something that can:
a) Play a midi file
b) Change track levels realtime
c) Change instruments for the tracks
d) Transpose tracks
e) Display the levels of the individual tracks realtime
f) Save the changes made to the file
As a start though, if I could just find some vb.net code to play a midi file and I can get to the other stuff once I understand that basics
Cheers for any help!
R
|
|
|
|
|
Hello,
I want to be able to calculate how long an event took. The user will enter the data using a datetimepicker for the start date, and when the event ends enter the stop date in a datetimepicker.
Does the datetimepicker capture the time when the date was set in one of these controls?
I have been using the dateDiff to calculate. However, it only gives me the difference between to dates but not the actual time it was set.
For example 26/2/2007 14:00 started
finisted at 28/2/2007 10:00
The total time would be 1 Day 4 hours (working 9 to 5pm)
Can anyone have any good ideas on how to calculate this,
Many thanks,
Steve
|
|
|
|
|
Try using the 'DATE DIFFERNECE' function ..... DDiff...
|
|
|
|
|
Hello,
That was the function that I was using. But I was having trouble calculating the hours that elapsed.
Thanks for any suggestions,
Steve
|
|
|
|
|
hi i want to keep connection string common to all windows forms as we keep in web.config file in asp.net
how to achieve that
with regards
Balagurunathan.B
|
|
|
|
|
put your connection string as a shared mumber of a class
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Try to define the connection string in a module as public and fill it when u first login to the main/first form. Then u can read it from every other form by calling its name and u can open and close the connection as many times as u want.
|
|
|
|
|
Hi, does anyone here know if vb.net 2005 has a "Print Screen" function to capture the Desktop image? (Just like if you were to press Ctrl + PrintScreen/SysRq".) I figure it has to, or at least have an easy way to access the Window's function for it. Thanks
it took a little trial and error, but...well, still nothing yet...
|
|
|
|
|
|
|
I amt trying to do, if stage =1 then top row..
Then another if to change the pic box and some text, Else write the other text value
Why aint this working, i think it is trying to do the other if yeah (being that it is aligned with it)???. Plus, why does it have a :, i didnt add it, i did it itself!
---
If stage = 1 Then
lblFormName.Text = "Top Row"
If intScoreTop <= 4 Then pcbIcon.Image = My.Resources.Cross_big()
lblScore.Text = "You did ok, but only got " & intScoreTop & vbCrLf & " out of 10"
Else : lblScore.Text = "Well done, you got " & intScoreTop & vbCrLf & " out of 10"
End If
---
|
|
|
|
|
What happens if you step through in the debugger ?
The rules for Then and EndIf are a little odd, from memory. I think your else will execute if state != 1.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It adds the colon as an in-line line break, because you can't have the statement following the Else on the same line.
Your second If statement is only affecting the statement on the same line, and the Else belongs to the first If statement.
Here is your code indented for clarity, and rearranged to not use one-line If statements:
If stage = 1 Then
lblFormName.Text = "Top Row"
If intScoreTop <= 4 Then
pcbIcon.Image = My.Resources.Cross_big()
End If
lblScore.Text = "You did ok, but only got " & intScoreTop & vbCrLf & " out of 10"
Else
lblScore.Text = "Well done, you got " & intScoreTop & vbCrLf & " out of 10"
End If
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi guys.
I have ASP.NET application and I create folder the application to store files.
Later on these files are access by database so I can parse them.
In order for database (db is on another machine) to see these files I must us UNC file path.
Of course the folder has to be shared so db can access it.
I can easily create folder but have no idea how to make it share.
Can anyone tell me how to do that?
Is there any easy way I can programatically create share folder right away?
Any code samples will be appreciated.
Thanks a lot.
Alex.
|
|
|
|
|
All you have to do is right-click the folder and click Sharing and Security (on XP). On the Sharing tab, enable "Share this folder" and give the Share a nice one word name.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I was wondering how do that in the code using VB.NET.
Thanks,
|
|
|
|
|
That's not how your original post sounded, but OK.
The easiest way is using WMI and the System.Management namespace to create the share.
Win32_Share[^] WMI class docs
ManagementObject.InvokeMethod[^] docs
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks Dave. You are right. I wrote some piece of code here, which does exactly what I need.
Since it's ASP.NET applicatioon I had some trouble in the beginning but then I found out that I need to import System.Management into my project and from there it was much better.
Try<br />
' Create a ManagementClass object<br />
Dim managementClass As System.Management.ManagementClass = New System.Management.ManagementClass("Win32_Share")<br />
' Create ManagementBaseObjects for in and out parameters<br />
Dim inParams As System.Management.ManagementBaseObject = managementClass.GetMethodParameters("Create")<br />
Dim outParams As System.Management.ManagementBaseObject<br />
' Set the input parameters<br />
inParams("Description") = "My Shared Files"<br />
inParams("Name") = partner_name<br />
inParams("Path") = Session("Path").ToString() ' This is a path to existing directory<br />
inParams("Type") = 0<br />
' Disk Drive<br />
' Invoke the method on the ManagementClass object<br />
outParams = managementClass.InvokeMethod("Create", inParams, Nothing)<br />
' Check to see if the method invocation was successful<br />
If (CType(outParams.Properties("ReturnValue").Value, Integer) <> 0) Then<br />
Throw New Exception("Unable to share directory.")<br />
End If<br />
Catch ex As Exception<br />
'Return e.Message<br />
End Try<br />
|
|
|
|
|
This is cool. Nice Post. Now, how do you automatically remove the share once it had been created (VB.NET code).
Dave
|
|
|
|
|
Is it possible to position (xy coordinates) the box that appears using messagebox.show?
Thanks
|
|
|
|
|
The short answer is no. A better option would be to create your own MessageBox class out of a normal form. You'll have all kinds of control over your own version.
The long answer is "with great effort", more than is required to make your own MessageBox class.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'm trying to create an aplication in VB 2005 that automatically (just by clicking one button) opens a web page, inserts an ID and a password on two text fields, clicks a button in the page and then takes all the information from that page and shows it in the VB application.
My problem is that I dont know how to program my application to insert text and click buttons automatically.
I been checking the webresponse and webrequest classes but I have no idea if those can solve the problem.
Thanks
|
|
|
|
|
I need to check files for having no content. I will possibly be checking some large files, is checking for a .Peek return of -1 sufficient and faster for this purpose?
I just discovered My.Computer.FileSystem.GetFileInfo(File).Length = 0 which I suppose it probably the best way to go.
-- modified at 16:45 Tuesday 27th February, 2007
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
Yup, I think checking the file size is the best way to go.
|
|
|
|