|
You're welcome; and I recognize the confusion/frustration
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Creates a shallow copy of the current Object. You're creating a new instance of your class, but sharing the same byte array reference. Changes to the array on one instance will update the array on the other instance.
Shallow Copy vs. Deep Copy in .NET[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi:
I work on a program that must capture the printout of a DOS application, filter its contents and send them to another printer.
Monitoring the print queue, I can detect the print job, but I need to take the name of the .spl file that contains the data to print or some way to take its content.
I use the PrintSystemJobInfo object but:
The JobStream property has a NULL value
Neither the JobName property nor the Name property point to the name of the file that contains the data.
(I have read the code of the PrinterQueueWatch project published in the articles, but it is too complex)
This is my first post in the forum.
I appreciate the help
modified 7-May-18 18:55pm.
|
|
|
|
|
Hay Guys,
I'm working on a subtitle editing program... I was wondering if there are other sdk's to play media files rather than the wmp.dll s. The wmp.dll doesn't support text overlaying in front of the video. Is there any other media player sdk to overlay text in front of the video playback?
|
|
|
|
|
Have you tried Fun with Video[^]?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Thank You I'll try it! But usually the video is rendered by the gpu in front of the window right? So if a window is kept in front of this gpu overlay will it be visible? The gpu always overlay it in front of everything right?
|
|
|
|
|
Asanka Akash Sovis wrote: So if a window is kept in front of this gpu overlay will it be visible? The GPU doesn't know about Windows and does not determine the paint-order. You do.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Hello,
I found this vb transcripten of the codeproject article mentioned below.
However sometimes I would like to see the whole picture in the ImageViewer.
For this I would have to set the autoscroll to false and the sizemode property of
the embedded imagebox to "stretch".
Do I have to create another property in ImageViewer to change the sizemode to
Normal, StretchImage, AutoSize, CenterImage, Zoom
I am afraid this is beyond my level. Could someone help?
Thank you.
Michael
Public Class ImageViewer
Inherits Panel
'based on http://www.codeproject.com/KB/linq/ScrollablePicturebox.aspx
Dim innerPicture As New PictureBox()
Dim mPictureFile As String = String.Empty
Dim mAutoScroll As Boolean = True
Sub New()
' add the inner picture
innerPicture.Top = 0
innerPicture.Left = 0
innerPicture.SizeMode = PictureBoxSizeMode.Normal
Controls.Add(innerPicture)
End Sub
Public Property PictureFile() As String
Get
Return mPictureFile
End Get
Set(value As String)
mPictureFile = value
If (String.IsNullOrEmpty(mPictureFile) = False) Then
' set the image to the image file
innerPicture.Image = Image.FromFile(mPictureFile)
' resize the image to match the image file
innerPicture.Size = innerPicture.Image.Size
Else
innerPicture.Image = Nothing
End If
End Set
End Property
Public Overrides Property AutoScroll As Boolean
Get
Return mAutoScroll
End Get
Set(value As Boolean)
mAutoScroll = value
End Set
End Property
End Class
|
|
|
|
|
Dear All,
I'm trying to figure out the way to overwrite the existing content of the text file after found the specific word. The example content of text file as below. I'm looking the example in VB.Net to overwrite the words after the "No = " and "ID = ".
Name = MyName
No = 12345678
ID = 2000S1-DD7-8TA
Home = SD-PS-D1
Thanks.
|
|
|
|
|
You load the text file into memory, like an array of strings. Make your replacements with String.Replace(), or whatever is appropriate for your situation, then write the entire file back out to disk.
|
|
|
|
|
As Dave described, load the file into an array of lines.
Replace won't work in this case, you need to chop up the line into
Text before the characters to be replaced
text to be replaced
text after the characters to be replaced
Repeat for the ID =
Then you need to concatenate the bits together with the replacement text. This is not difficult just fiddly and will take some time to get right.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi RAH,
Thanks for the guidance, however, I still unable make the code work as below. Appreciate if you could show the example.
MyProfile_File = "C\MyProfile\MyProfile.txt"
Dim MyProfile_StreamReader As New StreamReader(MyProfile_File)
Dim MyProfile_Content As String
MyProfile_Content = MyProfile_StreamReader.ReadToEnd
MyProfile_StreamReader.Close()
Dim MyProfile_StreamWriter As New StreamWriter(MyProfile_File, True)
Dim a As String()
a = Split(MyProfile_Content, vbCrLf)
Dim sFix As String
For i As Integer = 0 To a.Length - 1
sFix = a(i)
If a(i).IndexOf("ID = ") >= 0 Then
sFix = sFix.Replace(a(i).IndexOf("ID = ") + 1, "1122334")
End If
MyProfile_StreamWriter.WriteLine(sFix)
Next
MyProfile_StreamWriter.Close()
Thanks.
Best Regards,
EK Tan
|
|
|
|
|
It has been too many years since I coded in VB so no example!
You are doing what I said would NOT work - Replace is not going to work in this case because you do not know what to replace. You cannot work character by character you need to work with a string.
Get the POSITION after ID = and put the string to the left into another string - your start string
Locate the next space after the POSITION + 2 - this is the start of the end string get everything to the right of that position, it is your end string
Concatenate the start string + your replacement text + the end string
add this to a new array of lines to be written out.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Can you split on "=" and then concat new text?
If a(i).IndexOf("ID = ") >= 0 Then
dim split2 as string() = Split(a(i), "ID =")
sFix = split2(0) + "ID = 1122334"
End If
|
|
|
|
|
Hi speedbump99,
Thanks for the guidance, the problem solved.
|
|
|
|
|
I have developed a program with VS2010 that sends multiple files to an ftp folder. I would like to find a way to verify, after uploading, if all the files have been uploaded correctly. What should I use the CRC or file length? Thank you.
|
|
|
|
|
"file length" doesn't verify the "contents".
So yes, you need a CRC or MD5 calculation to help determine if a file is corrupted or not.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Gerry Schmitz wrote: So yes, you need a CRC or MD5 calculation to help determine if a file is corrupted or not.
thanks for the timely reply. Do you have any examples of crc or md5 verification code? Does the crc or md5 calculation do I have to do it on the local file or on the file uploaded to FTP or both? Thanks again
|
|
|
|
|
A typical CRC implementation involves:
1) Calc CRC for file
2) Add CRC to end of file
3) Transmit
4) Receiver parses / removes CRC from end of file received
5) Receiver recalcs CRC (for file "contents") and compares it with CRC received
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Check if the FTP server is supporting the File Transfer Protocol HASH Command for Cryptographic Hashes[^] (see at the bottom of that document for a list of FTP server software).
If so, you can create the hash for the local file using the same algorithm as marked in the FEAT response (or change the algorithm to be used) and compare it with the data returned from the HASH command.
[EDIT]
If not, check if the server supports one of the non-standard commands to return the check sum of a file. These are usually named like the algorithem.
[/EDIT]
Otherwise you would have to download the file to a different location and compare.
modified 2-May-18 11:08am.
|
|
|
|
|
Hi
Many apologies if this has been asked before, for the life of me I cannot find an answer (perhaps using the wrong search terminology).
Basically I've two tables in SQL - aircraft and status (they are linked with a foreign key) .
I've also got a form which has a combobox on it. This combobox contains 4 values which are located in status:
FMC
PMC
U/S
UNAVAIL
I've coded that part so that combobox displays above mentioned values (works fine):
Dim cboSelect As SqlDataAdapter = New SqlDataAdapter("SELECT condition FROM dbo.status", connection)
Dim cbox As New DataTable
cboSelect.Fill(cbox)
With cboServ
.DisplayMember = "condition"
.DataSource = cbox
End With
The problem I'm having is having the combobox display the actual value that is being used in the aircraft table. The record in aircraft (column name condition) is UNAVAIL. At the moment the Combobox defaults to FMC.
I know the SQL (well the query works whether its correct for VB or not I don't know)
SELECT condition FROM dbo.aircraft WHERE avNum='XXXXX'
Any help much appreciated TIA
|
|
|
|
|
Evenings im trying to solve this problem: i need to find all the possible results (using: +, -, *, /) from 4 numbers that we type in let´s say 4 text boxes and sho these results in a listbox or similar.
Im a bit lost as im no expert in programming and any help would be great
thanks in advance
|
|
|
|
|
Assuming only two numbers in each calculation. Then for each number, perform the operation with each of the other three numbers. In the case of add and multiply you need to check and ignore duplicate calculations.
|
|
|
|
|
Hi thank you for your reply. Im still trying to sort the math part of it. I think this involves over 2000 operations and if this is correct i dont think i can figure out the code cause really i dont know that much. I could do some "if" or "for each" or some "do while" stuff but if you guys think this is gonna take more than that please tell me
Thanks
|
|
|
|
|
I don't know where you got the number 2000 from, but maybe your original question was not complete.
|
|
|
|