![](https://www.xtremedotnettalk.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
usvpn
Avatar/Signature-
Posts
48 -
Joined
-
Last visited
About usvpn
- Birthday 01/01/1980
usvpn's Achievements
Newbie (1/14)
0
Reputation
-
Hi, I just have an English question because my En is not good. One form in my application needs to run as admin, while my whole application does not! However, when user wants to open that form and application is not run as admin I want to show user a message: Application is invoker while SystemToolsMenu needs administrator rights. Do you want to run it anyway? Anyone can help me make the above sentence better? Thanks :)
-
Howdy, I want my application to run only on Win7: Dim MyVersion As Version = Environment.OSVersion.Version Dim SevenVersion As New Version(6, 1, 0, 0) If Not Version.op_GreaterThanOrEqual(MyVersion, SevenVersion) Then End Above code will allow to run on 7 or later, how to change the condition to run only on 7? Thanks.
-
Hi, Using WebClient due to strict content filtering some times I cannot open an HTTPS address, but I can open the same HTTP address will open. So I want to try the HTTPS first, and if fails then try the HTTP, if it also fails then return the error. Dim WebClient As New System.Net.WebClient Dim NewString As String = WebClient.DownloadString("https://www.domain.com/file.txt") WebClient.Dispose() What's the best algorithm? I can try HTTPS and then try HTTP in CATCH or I can try each one in a separate TRY/CATCH and then evaluate their values or what? Thanks.
-
Hi, I am using .NET Framework 4.0 and want to do a task. I have a .zip file with a folder named "word" in the root and a file named "document.xml" in the folder! I want to unzip the <ZIP File>\word\document.xml on the fly and store the whole contents of document.xml in a string! I will need a function like this: Private Function GetContents(ByVal FileName) As String FileName is the name of source zip file and contents are stored as output! I need a VB.NET code snippet, anyone can help me here? Thanks :)
-
Please help, I'm driving crazy! This is the most strange thing I ever seen in .NET! I cannot find what's the problem and how to solve it! Private Sub SendFAXForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing Select Case RememberCheckBoxX.Checked Case False Try Dim MyConnection As New OleDbConnection(EmailDBString) MyConnection.Open() Dim MyCommands As New OleDbCommand("DELETE * FROM SendFAX", MyConnection) Dim MyReader As OleDbDataReader = MyCommands.ExecuteReader MyReader.Close() MyConnection.Close() Me.Close() Catch Exception As Exception MessageBoxEx.Show("There is an error resetting data in database." + vbNewLine + Exception.Message, My.Application.Info.AssemblyName, MessageBoxButtons.OK, MessageBoxIcon.Warning) End Try End Select End Sub It calls itself again & again!
-
snarfblam thanks, yes Form_Closing is not a good idea...
-
Thanks man, this code is inside the Form_Closing event...
-
I am newbie too, ah man, even you know what infinite recursion is, so I must be so stupid! I couldn't understand what did you mean by your post? Remind me to use Google rather than posting here? OK, I'll remember that! I really use the same code somewhere else and it works!
-
Hi, I use Microsoft Access Database Engine 2010 and my code which I already used it somewhere else throws an error I can't understand! Can anybody help me as it's just a few lines and snapshots are attached? Thanks.
-
This is a long and complicated process to make a 100% accurate regular expression to validate email address, but, I have a good one with 2 bugs, it reports the following valid email addresses as invalid: user@domain.museum (6 letter domain which is only museum?!) user@1domain.com (domain cannot start with numbers!) Since I am not familiar with regular expressions I want to know if anyone knows how to fix this 2 bugs? Please explain each of them separately so in case I don't want to use the 1st fix I can! Dim AddressPattern As String = _ "^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@" & _ "((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?" & _ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])\." & _ "([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?" & _ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|" & _ "([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$"
-
Yes, but for email client is a little different, email clients usually give so many character sets to users to choose! So I want to know which ones to remove, for example, the character sets which have MAC inside them, are available for Windows? What's the meaning of MAC? For target systems?
-
I am using an email component, it needs me to set the EmailMessage.CharSet property according to the supported values from this table: http://msdn.microsoft.com/en-us/library/system.text.encoding%28v=vs.80%29.aspx Like windows-1256 or utf-8... However, I know that not all of them are applicable for my Windows application which only runs on Intel x86 or x64 platforms and only WinXp, Vista, 7 OS. So which ones are applicable for me? For example, some MAC encoding, like x-mac-japanese or x-mac-arabic are for MAC only? Or can be used in Windows too? Or also for UTF-32, it always returns System.NotSupportedException
-
Good morning, I need to pass the Charset Encoding name which is defined in the 2nd column of the below table: http://msdn.microsoft.com/en-us/library/system.text.encoding%28v=vs.80%29.aspx Like windows-1256 or utf-8... However, I know that not all of them are applicable for my Windows application which only runs on Intel x86 or x64 platforms and only WinXp, Vista, 7 OS. So which ones are applicable for me? For example, some MAC encoding, like x-mac-japanese or x-mac-arabic are for MAC only? Or can be used in Windows too? Or also for UTF-32, it always returns System.NotSupportedException
-
Hi, I have a text file on a remote server with this content: - Line1 Line2 Line3 ... - I use this code to download it and put each line in a string (array) Dim WebClient As New System.Net.WebClient WebClient.Encoding = System.Text.Encoding.ASCII WebClient.CachePolicy = New System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore) Dim NewString As String = WebClient.DownloadString("http://www.domain.com/file.txt") WebClient.Dispose() Dim MyArray() As String = NewString.Split(vbNewLine) For MyLoop As Integer = 0 To MyArray.Length - 1 MsgBox(MyArray(MyLoop).ToString.Replace(vbNewLine, "")) Next It's OK, but when showing each line, the 1st line is OK. After 2nd line, it applies a vbNewLine/vbCrLf to the beginning of each line. And I CANNOT remove that, even with .Replace(vbNewLine, "") How to remove this vbNewLine/vbCrLf from beginning of each line? Thanks.