|
You can just use the KeyPress event of your form to intercept the incoming keys.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
ok IM a newb but I have an understanding of programing. I learned java last year but I didnt get very deep with it .....
my question is if I am using the FolderBrowserDialog how do you do something ...say move .... a file ... how would I name it .... or call the file/files selected by user
If I am not making sense let me know and all try and explain
|
|
|
|
|
You would get the collection of filenames selected through the filenames property. You would then manipulate the data using the System.IO namespace, if you are dealing with files you will use the File class in the System.IO namespace.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
I am working on an assin for school and neither of my books have anything on linklist, adn this program needs to be double linklist. does anyone know of a website that can teach me, and help me understand how a link list works.
thanks bryan
Bryan
nighthawk9923@yahoo.com
bankbrya@isu.edu
|
|
|
|
|
Linked_list[^]. You get a lot of links if you google for linked list
|
|
|
|
|
hello,
I want to record sound in .wav and .mp3 format. can anybody help me ? also I want the way to convert file form one foramt (eg.wav) to another eg(.mp3)
ciacia
|
|
|
|
|
The easy way is to buy Sony's SoundForge software and an Edirol UA-25 USB Audio Interface.
Works for me.
JimT
|
|
|
|
|
I have a device that sends a report to a printer through a USB connection. I want to capture the output through a USB port on my computer and save it as a .PRN file so I can mess with it before passing it to the real printer. Does anyone know how I can do this?
Perhaps a better question is, has anyone who is willing to share the secret done it?
Thanx,
JimT
|
|
|
|
|
You can't really do this unless you write your own USB printer driver so that your machine LOOKS LIKE a printer that the device can print to. Capturing the actual USB traffic won't do you any good because you'll be capturing the USB data along with the printer data.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I try to set text (pulled from Database) into a HyperLink and set it for an email.
Here is the code I try to use for it, but it only sets the "mailto" as string in front of it.
<asp:HyperLink ID="email" runat="server"
Text='<%# String.Format("mailto:{0}", Eval("email")) %>'></asp:HyperLink>
Using CommandArgument and couldn't set it in the LocationByArea_ItemCommand either
This is what I tryed:
Protected Sub LocationByArea_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles LocationByArea.ItemCommand
If String.Compare(e.CommandName, "ListAreas", True) = 0 Then
Dim str As String = e.CommandArgument.ToString()
LocationAreas.SelectParameters("areaID").DefaultValue = e.CommandArgument.ToString()
For Each item As DataListItem In Me.DataList1.Items
Dim email As Object = CType(item.FindControl("email"), HyperLink)
email.NavigateUrl = "mailto:" & email.Text
Next
End If
End Sub
Any suggestions how I could solve this?
|
|
|
|
|
Your question is more appropriate for the ASP.NET Forum[^].
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I'm currently posting the values in an HTML table as follows:
___________________________________________________
cid = Request.Form("stateabbr")
sql="SELECT State, CrossLinkFormID, DORFormID, FinalDraftDate, SubmissionDate, ApprovedDate, SubmissionNotes, AdditionalNotes FROM FormsTable WHERE State LIKE '" & cid & "%'"
rs.Open sql, conn
%>
Forms Submission for
<%Response.Write(cid)%>
<%
' Writing column headings
response.write("")%>
<%for each x in rs.Fields
response.write("")
next%>
'Writing Column values
<%do until rs.EOF%>
<%for each x in rs.Fields%>
<%next
rs.MoveNext%>
<%loop
rs.close
conn.close
%>
Select | " & x.name & " | | <%
Response.Write ("<id=" &="" x.name="" "="">" & x.value)
%> |
_________________________________________________________________
After clicking the button "Select Forms", how can I grab the values/rows in the table where the check box is check and use an sql statement to add these values/rows into a new table?
|
|
|
|
|
Your question is more appropriate for the ASP.NET Forum[^].
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Env: SQL2005 Sp2 Visual Studio 2005
Could not find stored procedure 'sbSetupDeptProfitnLoss'.
Test.sql has statement
exec sbSetupDeptProfitnLoss 1, 10,'6/1/2006'
A vb module in this project has
Partial Public Class StoredProcedures
Public Shared Sub sbSetupDeptProfitnLoss(ByVal BranchCode As Long, _
ByVal DepartmentCode As Long, _
ByVal RequestDate As Date)
Dim DepartmentName As String
Dim result As Object
Dim stDocName As String
Dim StartofMonth As Date
Dim EndOfMonth As Date
Dim StrStartofMonth As String
Dim fnBuildBudgetQuery
On Error GoTo Err_sbSetupDeptProfitnLoss
sbGetDepartmentName(DepartmentCode, DepartmentName)
StrStartofMonth = DatePart("m", RequestDate) & "/" & "01/" & DatePart("yyyy", RequestDate)
StartofMonth = StrStartofMonth
EndOfMonth = EOMonth(StartofMonth, 1)
sbBuild_L1QueryDeptSalesDetail(BranchCode, DepartmentCode, StartofMonth, EndOfMonth)
sbBuild_L1QueryDeptCostOfGoodsDetail(BranchCode, DepartmentCode, StartofMonth, EndOfMonth)
sbBuild_L1QueryDeptExpensesDetail(BranchCode, DepartmentCode, StartofMonth, EndOfMonth)
sbBuildDeptSummaryProfitnLossTable(DepartmentCode, RequestDate)
stDocName = "rptDeptProfitnLoss"
'DoCmd.OpenReport(stDocName, acPreview)
Exit_sbSetupDeptProfitnLoss:
Exit Sub
Err_sbSetupDeptProfitnLoss:
fnHandleError("sbSetupDeptProfitnLoss")
Resume Exit_sbSetupDeptProfitnLoss
Resume
End Sub
End Class
rkj
|
|
|
|
|
Did you attribute this class and the sub appropriatly for use as a stored procedure? It doesn't look like it.
Documentation on SqlProcedure attribute[^]
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Thank You Very Much. That Solved the problem
rkj
|
|
|
|
|
I am writing an application that will globally add a print queue to a target PC. I can get lists from Active Directory of my print servers and my host PCs. What I'd like to do is have the user click on the print server, and my application will enumerate all print queues on that server and list them. The user will then select a print queue and a remote host, and click a button to install the printer. I can do everything except enumerate the print queues on the print server. If someone could please help with this, I'd greatly appreciate it . I am coding with Visual Studio .Net 2005 and VB .Net.
Thanks,
DotCom
Help Desk Analyst
(programmer on the side)
|
|
|
|
|
As a PS to the above, I have been able to find examples in C#, but am not able to port them to VB.
DotCom
Help Desk Analyst
(programmer on the side)
|
|
|
|
|
NFDotCom wrote: but am not able to port them to VB.
Which part of the c# code are you not able to port to VB? you can post the part your facing difficulty and someone could help
|
|
|
|
|
Search for 'WMICodeCreator'; I downloaded it from Microsoft and used it to do exactly what you are asking for.
I was able to get a list of printers on our print server and other needed information.
Tim
|
|
|
|
|
Awesome, thanks Tim! I'll check it out, and see if that works for me.
DotCom
Help Desk Analyst
(programmer on the side)
|
|
|
|
|
Thanks Tim, that will work for me. That program is going to save me from so many headaches.
|
|
|
|
|
Good... the power of a community working together...
|
|
|
|
|
Ok, I almost have it working, except I'm now get a NullReferenceException error (Object not set to an instance of an object) on the line marked with a "-->". The error is directly following this paragraph, and my sub procedure is below the error. I call the sub like this: GetPrinters("name-of-server"). If you could help me out, I'd really appreciate it.
Error details:
<br />
System.NullReferenceException was unhandled<br />
Message="Object reference not set to an instance of an object."<br />
Source="ResHelp Troubleshooter"<br />
StackTrace:<br />
at ResHelp.frmAddPrinter.GetPrinters(String strServer) in C:\Users\adamb\Desktop\ResHelp Troubleshooter\ResHelp Troubleshooter\frmAddPrinter.vb:line 68<br />
at ResHelp.frmAddPrinter.lbxServer_SelectedIndexChanged(Object sender, EventArgs e) in C:\Users\adamb\Desktop\ResHelp Troubleshooter\ResHelp Troubleshooter\frmAddPrinter.vb:line 80<br />
at System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)<br />
at System.Windows.Forms.ListBox.WmReflectCommand(Message& m)<br />
at System.Windows.Forms.ListBox.WndProc(Message& m)<br />
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)<br />
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)<br />
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br />
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)<br />
at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)<br />
at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)<br />
at System.Windows.Forms.Control.WmCommand(Message& m)<br />
at System.Windows.Forms.Control.WndProc(Message& m)<br />
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)<br />
at System.Windows.Forms.ContainerControl.WndProc(Message& m)<br />
at System.Windows.Forms.Form.WndProc(Message& m)<br />
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)<br />
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)<br />
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br />
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)<br />
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)<br />
at System.Windows.Forms.Control.DefWndProc(Message& m)<br />
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)<br />
at System.Windows.Forms.Control.WndProc(Message& m)<br />
at System.Windows.Forms.ListBox.WndProc(Message& m)<br />
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)<br />
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)<br />
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br />
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)<br />
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)<br />
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<br />
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<br />
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)<br />
at System.Windows.Forms.Form.ShowDialog()<br />
at ResHelp.frmMain.btnGo_Click(Object sender, EventArgs e) in C:\Users\adamb\Desktop\ResHelp Troubleshooter\ResHelp Troubleshooter\frmMain.vb:line 15<br />
at System.Windows.Forms.Control.OnClick(EventArgs e)<br />
at System.Windows.Forms.Button.OnClick(EventArgs e)<br />
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)<br />
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)<br />
at System.Windows.Forms.Control.WndProc(Message& m)<br />
at System.Windows.Forms.ButtonBase.WndProc(Message& m)<br />
at System.Windows.Forms.Button.WndProc(Message& m)<br />
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)<br />
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)<br />
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br />
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)<br />
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)<br />
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<br />
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<br />
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)<br />
at System.Windows.Forms.Form.ShowDialog()<br />
at ResHelp.modMain.main() in C:\Users\adamb\Desktop\ResHelp Troubleshooter\ResHelp Troubleshooter\modMain.vb:line 11<br />
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)<br />
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)<br />
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()<br />
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)<br />
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)<br />
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()<br />
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br />
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
at System.Threading.ThreadHelper.ThreadStart()<br />
VB Code to the sub procedure:
<br />
Private Sub GetPrinters(ByVal strServer As String)<br />
Try<br />
Dim connection As New ConnectionOptions<br />
connection.Username = Me.txtUsername.Text<br />
connection.Password = Me.txtPassword.Text<br />
connection.Authority = "ntlmdomain:" + My.Settings.Item("domain").ToString<br />
<br />
Dim scope As New ManagementScope("\\" + strServer + "\root\CIMV2", connection)<br />
scope.Connect()<br />
<br />
Dim query As New ObjectQuery("SELECT * FROM Win32_Printer")<br />
<br />
Dim searcher As New ManagementObjectSearcher(scope, query)<br />
<br />
Me.lbxPrinterShare.Items.Clear()<br />
<br />
For Each queryObj As ManagementObject In searcher.Get()<br />
'If Not (queryObj("ShareName").ToString = "''" Or queryObj("ShareName").ToString = "" Or queryObj("ShareName").ToString = Nothing) Then<br />
--> Me.lbxPrinterShare.Items.Add(queryObj("ShareName").ToString)<br />
'End If<br />
Next<br />
Catch err As ManagementException<br />
MessageBox.Show("An error occurred while querying for WMI printer data: " & err.Message)<br />
Catch unauthorizedErr As System.UnauthorizedAccessException<br />
MessageBox.Show("Connection error (user name or password might be incorrect): " & unauthorizedErr.Message)<br />
End Try<br />
End Sub<br />
DotCom
Help Desk Analyst
(programmer on the side)
|
|
|
|
|
Well, I'm not sure...
Normally, I get the 'Name' attribute, but, my code is written to allow the user to select the desired attributes. When I selected 'ShareName', I had no errors.
Have you confirmed that you can get the sharename using the WMICodeCreator?
|
|
|
|
|