
OMID SOFT
Avatar/Signature-
Posts
37 -
Joined
-
Last visited
About OMID SOFT
- Birthday 12/26/1982
Personal Information
-
Visual Studio .NET Version
Visual Studio Team System 2008
OMID SOFT's Achievements
Newbie (1/14)
0
Reputation
-
The problem is that controls on second tab were never displayed on screen so Windows Forms framework hasn't created Windows Handles for them. You can ensure that is done if you for example execute this code before you start your thread: If Not ReportTextBoxX2.IsHandleCreated Then Dim handle As IntPtr = ReportTextBoxX2.Handle End If
-
Nobody here converts your code for you, my suggestions by priority: 1. Learn VB.NET and do it yourself. 2. Use "Upgrade Visual Basic 6 Code" wizard. 3. Visit rentacoder.com...
-
This is what you should be using... Dim MyConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Excel.xls;Extended Properties=Excel 8.0;") MyConnection.Open() Dim SchemaTable As New DataTable SchemaTable = MyConnection.GetOleDbSchemaTable(Data.OleDb.OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, "TABLE"}) For MyLoop As Integer = 0 To SchemaTable.Rows.Count - 1 MsgBox("SELECT * FROM " + SchemaTable.Rows(MyLoop)!TABLE_NAME.ToString) Dim MyCommands As New OleDbCommand("SELECT * FROM [" + SchemaTable.Rows(MyLoop)!TABLE_NAME.ToString + "]", MyConnection) Dim MyReader As OleDbDataReader = MyCommands.ExecuteReader If MyReader.HasRows = True Then While MyReader.Read For MyReadLoop As Integer = 0 To MyReader.FieldCount - 1 If MyReader(MyReadLoop).ToString <> Nothing Then MessageBox.Show(MyReader(MyReadLoop).ToString) End If Next End While End If MyReader.Close() Next
-
I never recommend this code in the .NET environment, but however, this is the only way I know about this. Let's see what the others will say... Dim db As DAO.Database Dim DAODBEngine As New DAO.DBEngine() db = DAODBEngine.OpenDatabase("D:\Book1.xls", False, True, "Excel 8.0;") For MyLoop As Integer = 0 To db.TableDefs.Count.ToString - 1 MessageBox.Show(db.TableDefs(MyLoop).Name) Next db.Close()
-
An application raises the UnhandledException event when it encounters an unhandled exception. For instance, you can use this event to ask user send you a report by email. Private Sub UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) If MessageBox.Show("Unhandled exception has occurred in My Application." + vbNewLine + "We ask you to report this error to My Company." + vbNewLine + "Would you like to send a report via email?", My.Application.Info.AssemblyName, MessageBoxButtons.YesNo, MessageBoxIcon.Error) = DialogResult.Yes Then Dim MyString As String = Nothing MyString = ("x-receiver: <user@company.com>" + vbNewLine) MyString = MyString + ("To: ""user@company.com"" <user@company.com>" + vbNewLine) MyString = MyString + ("Subject: Bug Report - My Product " + My.Application.Info.Version.Major.ToString + "." + My.Application.Info.Version.Minor.ToString + vbNewLine) MyString = MyString + ("Date: " + Now.DayOfWeek.ToString.Substring(0, 3) + ", " + Now.ToString("dd") + " " + Now.ToString("MMMM").Substring(0, 3) + " " + Now.ToString("yyyy") + " " + Now.ToString("HH:mm:ss") + " " + TimeZone.CurrentTimeZone.GetUtcOffset(Now).ToString.Replace(":", "").Substring(0, 5) + vbNewLine) MyString = MyString + ("X-Priority: 3" + vbNewLine) MyString = MyString + ("MIME-Version: 1.0" + vbNewLine) MyString = MyString + ("Content-type: text/plain; charset=Windows-1252" + vbNewLine) MyString = MyString + ("Content-Transfer-Encoding: quoted-printable" + vbNewLine + vbNewLine) MyString = MyString + (e.Exception.ToString + vbNewLine) Dim TempPath As String = System.IO.Path.GetTempPath + "Report_" + Now.ToString("MM-dd-yyyy") + "_" + Now.ToString("HH-mm-ss") + ".eml" If My.Computer.FileSystem.FileExists(TempPath) Then System.IO.File.SetAttributes(TempPath, FileAttributes.Normal) My.Computer.FileSystem.DeleteFile(TempPath) End If My.Computer.FileSystem.WriteAllText(TempPath, MyString, False) System.Diagnostics.Process.Start(TempPath) End If End Sub Why you should NOT use this event? Although this is a useful event to control, debug and report the errors, but Microsoft does not recommend to use it. According to Certified For Windows Vista guidelines: Verify that the application only handles exceptions that are known and expected. (Test Case number 32.) Expected Behaviour: 1. All of the application�s executables above; when injected Access Violation (AV) resulted in the application crashing and must display the WER (Windows Error Reporting) dialog message in order to pass this test case. This means that the application AV failure properly allowed Windows Error Reporting to report this crash. 2. There must be both an Error message with �Source� listed as Application Error and an Information message with �Source� listed as Windows Error Reporting for each executable above in order to pass this test case. STEPS: 1. Browse application install paths for all executables which contain only the .exe extension. 2. For each of the application�s executables above: a. Launch the application�s executable. b. Open command window. c. Change directories to the directory that contains ThreadHijacker. d. From the command window inject an AV crash using ThreadHijacker in the following manner: i. Type �threadhijacker.exe /ui /crash:av /process:<process_name>� e. Open Event Viewer by typing eventvwr from the command line or from the Administrator Tools. i. Expand Windows Logs ii. Click on Application iii. There must be an Application Error (Error) and Window Error Reporting (Information) message for the executable.
-
Regular Expressions will do the trick for you, but however, this is a time consuming task, if this is OK with you, here is an open source COM component to extract the different parts of HTML documents: http://www.miken.com/htmlzap/index.htm
-
Of course it's possible! I can show you a tool but it's not free, "Component One PDF" is a component for .NET applications so enable them to work with PDF files. If you use it, the only thing left is creating Excel files. So you can do something like: Dim ExcelString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FileTextBox.Text + ";Extended Properties=Excel 8.0;" Dim ExcelConnection As New OleDbConnection(ExcelString) ExcelConnection.Open() Dim ExcelCommand As New OleDbCommand() ExcelCommand.Connection = ExcelConnection ExcelCommand.CommandText = "CREATE TABLE Sheet1 (TableName Char(255))" ExcelCommand.ExecuteNonQuery() ... ExcelConnection.Close()
-
Hope the following code snippet should be helpful for you. I believe you should be able to add this snippet appropriately to your code. Imports Microsoft.VisualBasic.ApplicationServices Namespace My ... Partial Friend Class MyApplication Private Sub MyApplication_CantStartSingleInstanceException(ByVal sender As Object, _ ByVal e As StartupNextInstanceEventArgs) Handles Me.StartupNextInstance ' Take Necessary Action MessageBox.Show("Single Instance Only") End Sub End Class ... End Namespace
-
This is impossible! :confused:
-
If you wrote the assembly, first sign it, second obfuscate it, third add a static LicenseKey class to get the license key from user and unlock the features.
-
http://www.xtremedotnettalk.com/showthread.php?t=100866
-
If you use System.Net.Mail and want to authenticate yourself with AUTH-LOGIN, MD5 or NTLM you CANNOT! System.Net.Mail does not support authentication.
-
While working with Win32_Printer Class you may wish to check out GetDeviceCaps to retrieve some information on device. Although I am not sure if it leads you to what you want. But you can have a list of the common ones hard coded.
-
1. Yes 2. No 3. XP does not have UAC