|
The proper location and scope of the UpdateNeeded variable will depend somewhat upon the application. For a user-class control that has a single 'update everything' method, it's probably easiest to include the variable within the control's class and then have a public 'update asynchronously' method. For standard controls, it's probably easiest to use an updateNeeded variable within the scope of the parent object (if there are several controls that may independently need to be updated, they should have separate updateNeeded variables).
The Threading.Interlocked.Exchange() is done in an if-test to see if BeginInvoke should be called.
BeginInvoke will throw an unavoidable exception if an object is disposed just before it is called. I'm not sure under what other conditions it may throw an exception, but if for any reason BeginInvoke fails, the updateNeeded variable will never get set back to 0 unless the routine that was supposed to call BeginInvoke resets it.
|
|
|
|
|
Hi all.
I have problem, I use WebBrowser object in my program and I need to get http request (POST/GET).
Someting like this:
POST /path/script.cgi HTTP/1.0
From: example.ge
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 32
home=Cosby&favorite+flavor=flies
|
|
|
|
|
david bagaturia wrote: I need to get http request (POST/GET)
What do you mean?
You could make HTTP requests with the HttpWebRequest class[^].
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
ok.
I mean that I have web brouser object in my form and this object link to www.example.ge and I need to get
http (POST/GET). I need to get http request that send this object to host.
|
|
|
|
|
So create a HttpWebRequest and set the Method property to POST or GET
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Alo a todos que vivas enes las estudian'os unidos,
Pero que paso. En reallydad las todos son .
Adios son las todos que necisitoyoqueestanentodo.
Troy O Yort
|
|
|
|
|
hello all,
am using TripleDes as the encryption method in the code below. The encryption went on successfully but i dont seem to know what is happening when I want to decrypt the data, the "null reference error" keeps on popping up.
What am i not getting right in the code?
Pls, I will appreciate any help.
Thank a lot.
Private Sub decryptBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles decryptBtn.Click
Try
Dim deRecData As String
' Dim decTripDe As New TripleDES
Dim decData As New TripleDES
LoadData()
' Configure and execute the command.
cmd = New System.Data.SqlClient.SqlCommand("SELECT * FROM Lab where patient_Id = @Pat_ID")
cmd.Connection = cn
Dim paraPatId As SqlParameter = cmd.Parameters.Add("@Pat_ID", txtEncryptedBytes.Text)
' Load the DataTable.
datadapt = New System.Data.SqlClient.SqlDataAdapter(cmd)
ds = New DataSet
datadapt.Fill(ds)
ds.Tables.Add(dt)
'datGrid.DataSource = ds.Tables(0)
cn.Close()
'Dim dt As DataTable
'Dim dc As DataColumn
Dim dRow As DataRow
dRow = dt.NewRow
For Each dRow In ds.Tables("Lab").Rows
decData = New TripleDES()
deRecData = decData.Decrypt(dt.Rows(0)("Test_type"))' -->error here, null reference
dt.Rows.Add(deRecData)
ds.Tables.Add(dt)
MsgBox("what is that")
Next
datGrid.DataSource = ds.Tables(0)
Catch ex As SqlException
MsgBox(ex.Message.ToString())
Finally
End Try
End Sub
Public Function Decrypt(ByVal inputInBytes() As Byte) As String
' UTFEncoding is used to transform the decrypted Byte Array
' information back into a string.
Dim utf8encoder As UTF8Encoding = New UTF8Encoding()
Dim tdesProvider As TripleDESCryptoServiceProvider = New TripleDESCryptoServiceProvider()
' As before we must provide the encryption/decryption key along with
' the init vector.
Dim cryptoTransform As ICryptoTransform = tdesProvider.CreateDecryptor(Me.key, Me.iv)
' Provide a memory stream to decrypt information into
Dim decryptedStream As MemoryStream = New MemoryStream()
Dim cryptStream As CryptoStream = New CryptoStream(decryptedStream, cryptoTransform, CryptoStreamMode.Write)
cryptStream.Write(inputInBytes, 0, inputInBytes.Length)
cryptStream.FlushFinalBlock()
decryptedStream.Position = 0
' Read the memory stream and convert it back into a string
Dim result(decryptedStream.Length - 1) As Byte
decryptedStream.Read(result, 0, decryptedStream.Length)
cryptStream.Close()
Dim myutf As UTF8Encoding = New UTF8Encoding()
Return myutf.GetString(result, 0, decryptedStream.Length)
End Function
End Class
|
|
|
|
|
nedusmile wrote: deRecData = decData.Decrypt(dt.Rows(0)("Test_type"))' -->error here, null reference
OK, stating the obvious, the error message means that an object on that line is null. The debugger will show you what is wrong but if I had to make a guess I'd say the DataTable dt has no rows.
Alan.
|
|
|
|
|
even when I use the following section, it still shows error:
Dim dRow as DataRow
dRow = dt.NewRow()
For Each dRow In ds.Tables("Lab").Rows
decData = New TripleDES()
deRecData = decData.Decrypt(dRow.Item("Test_Type")) ' -->error here, null reference
dt.Rows.Add(deRecData)
ds.Tables.Add(dt)
MsgBox("what is that")
Next
|
|
|
|
|
nedusmile wrote: deRecData = decData.Decrypt(dRow.Item("Test_Type")) ' -->error here, null reference
Well that would lead me to assume that there is no "Test_Type" column.
I know.
You are going to tell me that you know there is, as you created it etc.
I have had similar problems in the past where the column name has somehow got a space inserted into it, either at the beginning or end. So I would suggest that you attempt to check for errors of that sort.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Henry, but if a i pull data without the loop, it will display without problem. Which means that there is no problem with the "Test_Type".
Please any more suggestions or links !
|
|
|
|
|
Please can anyone tell me how to display Ads on windows forms since there is no adrotator control in windows application development.
I would greatly appreciate any comments and ideas you may have with regards to this question.
Thanks in advance
|
|
|
|
|
How about a WebBrowser [^]? It can display various formats and it's quite easy to rotate the contents
I are troll
|
|
|
|
|
Thanks for your reply. The webbrowser control sure does display ads. I would like to know if i can dock (centralize) the gif ad. Thats is making sure the ad fits properly in the control.
|
|
|
|
|
You can use HTML to format the contents, setting the center tag or the align-attributes within the HTML-document.
I are troll
|
|
|
|
|
Thanks alot, your advice worked and am very grateful.
|
|
|
|
|
Hai friends,
Can open a password protected file for uploading and streamming.I want to implement in webapplication.IF it's can u tell me that solution
Thanks in advance.
Cheer,
MAHESH.K
|
|
|
|
|
Password protected in what way?
Is the file system denying access unless you have the correct credentials?
Is the file itself encrypted and you need the correct key to decrypt it?
Is it some other way?
|
|
|
|
|
No. Just i goona upload a password protected file. at that time i wanna promot message box for feeding password
|
|
|
|
|
Okay - So, I still don't understand in which way the file is actually protected. Saying it is "password protected" is too vague as there are a multitude of ways in which a "password" could be applied to a file.
I'm going to assume that you can access the file (so it isn't the file system provding the "password protection"). You just upload the file as you would any other file. There is no difference.
You want to promt the user for the password? At what point? Before uploading? After uploading? Does it matter because it is just a text box.
Now, what you do with the what the user has given you in the text box and the file is probably the bit you are really after. Uploading files, and getting the contents of a text box are simple. Right? Accessing "password protected" data is the difficult bit.
So, my question remains: Exactly how is the file password protected? What is the mechanism for protection. The password is the key, but unless you know how the lock works, how do you know what to do with the key?
|
|
|
|
|
I'll continue with thanks
in net if we upload any file using file upload control,it won't ask for any
protection. I need to apply password when i click on upload control.No one can open open or download
with out knowing that password.Thank u once again for your consideration.
Cheer,
MAHESH.K
|
|
|
|
|
So the file isn't password protected at all - you're the one doing the protecting and you want to require a password. Right?
Now that's easy. Last modified: 14mins after originally posted -- fixed typo
|
|
|
|
|
MaheshSelva wrote: No one can open open or download
with out knowing that password.
Now that is different from what you seemed to be asking for.
Basically, you want a web application to provide password protection so that no one can download the file unless they are already authenticated with the site and authorised to do so.
You may want to look at Forms Authentication[^]. You then want to look at using an ASPX page to stream the file. Something like this: http://forums.asp.net/t/1263188.aspx[^], but with an authorisation check before it actually streams anything out.
|
|
|
|
|
Can we create a 3D project in VB.Net?
If we can, please express me any project or some codes...
thank you
|
|
|
|
|