|
Hello All,
I'm having some trouble with this Web Service that I'm writing for work. The web service needs to sign incoming/outgoing requests with a valid X509 Certificate. I've written and tested the service here on my machine and it works fine with test certificates that I made via the makecert tool. My Company purchased a certificate from a well-known CA, but for some reason I can't get the Service to operate coorrectly with the purchased certificate. As far as I can tell it is installed correctly on our server (IIS 6.0). When I try to access the certificate programatically per the code below, I get an error that "the keyset does not exist". The private key file is there, I can pull it up with the WSE 2.0 Certificate tool and view the file, the permission are also correct, I'm logged in as Administrator with full control over all the directories/subdirectories.
CODE :
Private Function getSigningToken() as X509SecurityToken
Dim res as String = String.Empty
Dim securityToken As X509SecurityToken = Nothing
Dim store As X509CertificateStore = _
X509CertificateStore.LocalMachineStore( _
X509CertificateStore.TrustStore)
Dim open As Boolean = store.OpenRead()
Try
Dim certs As X509CertificateCollection = _
store.FindCertificateBySubjectName(cName)
Dim cert As Microsoft.Web.Services2.Security.X509.X509Certificate = _
CType(certs(0), Microsoft.Web.Services2.Security.X509.X509Certificate)
If cert Is Nothing Then
res = ("You chose not to select an X.509 " + _
"certificate for signing your messages.")
securityToken = Nothing
>ERROR HERE --> ElseIf (Not cert.SupportsDigitalSignature Or(cert.Key Is Nothing)) Then
res = ("The certificate must support digital " + _
"signatures and have a private key available.")
securityToken = Nothing
Else
securityToken = New X509SecurityToken(cert)
End If
Catch ex As Exception
res = ex.Message
Finally
If Not (store Is Nothing) Then
store.Close()
End If
End Try
Return securityToken
End Function
Do I need some special kind of certificate?
Shouldn't any type of X509 certificate work for signing soap request?
Any help at all is much appreciated. I've been searching the internet for a solution for about a week now. I've seen many who have this problem, but none have posted solutions (with the exception of security permissions, which I don't believe is my problem). Thanks in Advance for all your help.
|
|
|
|
|
|
Hello all,
I am using asp.net 2.0 GridView control. This grid is enabled Paging, i.e like this...
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)<br />
{<br />
GridView1.PageIndex = e.NewPageIndex;<br />
BindMessageGrid();<br />
}<br />
. This is working fine.
This Grid is having 3 columns(Name,Suject,Date) I am sorting the columns like this...
<br />
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)<br />
{<br />
int index = GridView1.PageIndex;<br />
DataTable dt = GetDataTable();<br />
DataView dv = new DataView(dt);<br />
<br />
dv.Sort = e.SortExpression + " " + GetSortDirection();<br />
GridView1.DataSource = dv;<br />
GridView1.DataBind();<br />
GridView1.PageIndex = index;<br />
}<br />
This Grid is showing 3 pages. When I click on first page first column(Name), first it is showing in Descending(i.e Z,Y...A) with same 3 pages.
Problem is here...
Now if i will go 2nd page. it is resetting the page.
my Problem is when click on firtColumn sort(by Name) it has to show 3rd page contents in 1st page. if i will go 3rd page, it has to show 1st page contents.
How to Handle this?
anybody any solutions. plz help me will be appriciated
regards
GV Ramana
|
|
|
|
|
hello I want to create controls from coordinates that I have in a data base, as for example a label with properties text, tag.
But that this label is created agreed the coordinates not nesecariamente must be rectangle can be a trapezoid.
thanks for its aid
Juanjo
|
|
|
|
|
Dim newTextBox As New TextBox
newTextBox.Location = New Point(x, y)
newTextBox.Size = New Size(sx, sy)
newTextBox.Text = someText
newTextBox.Tag = someTagValue
Me.Controls.Add(newTextBox)
This is the same way the Forms designer writes the code when you drop a TextBox (or whatever) on a form at design time.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello Friends,
I am facing a problem in copying a table from SQL SERVER to Access DataBase. I have identical tables in access database to and what i am trying is creating 2 datasets, one is connected to SQL Server DB and another one is connected to Access DB. Now when I use the "Copy" command of dataset to copy data from one dataset to another dataset and then updating the adapter it throws no error but access database doesnt reflects refreshed data.
Do you guys have some working code on this problem.
thanks in advance
Regards
Sheel
Sheel Gohe
|
|
|
|
|
Well, I've never had to do this. And, frankly, don't want to.
Off the top of my head, you can't do this between two different databases because the underlying database types are different. For instance, SQL Server supports the bit type, where Access does not. The Data/Time storage formats are different, different Integer types are supported, Currency, ..., yada, yada, yada. The Copy method will NOT translate this for you.
So, no, I'd say you can't do this using this method. You'd have to read each individual record and field from the source table, translate the data, then put the new data in an Update or Insert query in the Access database.
The other alternative is to construct a DTS job to do the export for you. This will, of course, depend on the Access file being put someplace where the SQL Server can write to it and you can pick it up after the job completes.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am building a balloon tip and I need to be able to locate all rectangles so that when someone draws on the tip i can relocate it to be within the bounds of the tip.(I want to establish a new starting point (0,0)). It would make it easier for the user instead of having to figure out where 0,0 is and adjust for it. I am only able to do this with controls.
Whenever someone puts a control or draws out of the bounds it cannot be seen.
I am just tring to make it easier.
Can this be done
THANKS
Mark Thibodeaux
-- modified at 17:32 Tuesday 11th April, 2006
|
|
|
|
|
PLEASE dont scream.
Don't write your question in all upper case, and someone might manage to read it.
---
b { font-weight: normal; }
|
|
|
|
|
Hello
Is there any tutorials available for windows media encoding ie converting avi to wmv using visual studio.net 2005 in VB.
I have found SDK in Microsoft site but it runs in Visual Studio 2003 but not in 2005 when the project is converted.
So I need help to get some source code that will convert a avi file to WMV.
Thanks and Regards
Help in need is the help indeed
|
|
|
|
|
Is their a way to include all referenced dlls into the compiled exe file?
/Thaks
Johan
|
|
|
|
|
You could add them as resources. But, you'll need to extract them back to the disk in order to use them.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Ok,
Well I guess I could but it dont think it would be worth the work it involves. But thanks anyway.
/Johan
-- modified at 9:49 Tuesday 11th April, 2006
|
|
|
|
|
You can use ILMerge[^] to combine compiled .Net assemblies. Its a command line program so you can just load up cmd and run something similar to the following (as long as ILMerge.exe is somewhere in your PATH):
ilmerge /out:MyExe.exe MainAssembly.exe ReferencedDll1.dll ReferencedDll2.dll That will combine MainAssembly.exe , ReferencedDll1.dll and ReferencedDll2.dll into a stand alone exe called MyExe.exe . This exe can then be distributed on its own.
Hope this helps
Cheers,
Will H
|
|
|
|
|
|
Im using Visual Basic 6.0 and facing a problem...an error message occurs
Run Time Error : 402
must close/hide modal form
This error occurs sometimes when I use to save some record on a modal form...If I close the error message application would be closed.
Plz help me to trace out this problem...what could be the reason behind it.
Thanx in advance
Noshaba Mariam
|
|
|
|
|
You're trying to close a Modal form that isn't at the top of the z-order. In other words, You have a form that opened a modal form, that itself, opened a modal form. You have to close the forms in the reverse order that you opened them.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thnx for the help ... Now I have bcome able to solve my problem...
Noshaba
|
|
|
|
|
how can i set the session for my login page that no one is able to access the page directly.he/she must login first.
|
|
|
|
|
I think you are dealing with ASP or PHP related to a web site. If you do so, here is my advice:
You have to control every entry related to admnistration to your web site. It is likely create a sub procedure and check the session variable if it has a initiated value.
Sub Check_Security()
' check if someone is trying to get in the pages by directly typing the
' page name
If Session("Log_UserID") = "" OR Session("Log_MemberType") <> "admin" Then
response.redirect ("../quit.asp")
End if
End Sub
Check_Security() procedure should be in every asp or php (admin) related web pages (on top of the page). The example above shows how to control a user if he or she is a admin... You can change it vice versa...
I hopw that works out for you !
|
|
|
|
|
In my VS2003 project I send mail and it sends 7-8 times every time I send it?
I have the following code in my global.asax code, The problem is the receiver gets 7-8 copies every time i SEND IT?
Public Class Global
Inherits System.Web.HttpApplication
#Region " Component Designer Generated Code "
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Required by the Component Designer
Private components As System.ComponentModel.IContainer
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub
#End Region
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
'1. Create a connection
Dim myConnection As New SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
myConnection.Open()
'2. Create the command object, for the query
Const strSQL As String = "Select LastUpdated, ProductId from products "
Dim objCmd As New SqlCommand(strSQL, myConnection)
Dim objDR As SqlDataReader
Dim att
objDR = objCmd.ExecuteReader()
While (objDR.Read)
If (Not (objDR("LastUpdated") Is DBNull.Value)) Then
If (Date.Compare(objDR("LastUpdated"), Today.Date) = 0) Then
Dim newMail As New MailMessage
newMail.From = "zzzxyz@msn.com" '' this is the From Address
newMail.To = "bill@msn.com" '' this is TO Address
'newMail.Cc = "ken@dtyinc.net" '' this is TO Address
newMail.Subject = "Change in Product Rate"
newMail.Body = " Dear Ken, " & "Please review attached document for product ID: " & objDR("ProductID") & "Thank you," & "Kenn()"
att = New MailAttachment("C:\Inetpub\wwwroot\GrocerToGo\Product_Changed.doc")
newMail.Attachments.Add(att)
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "bill@dtyinc.net")
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "Password")
SmtpMail.SmtpServer = ""
SmtpMail.Send(newMail)
End If
End If
End While
myConnection.Close() 'Close the connection
End Sub
|
|
|
|
|
In my Global asax file aDo I need the code below newmail.fields.add and why do I need them?
The first one works but it puts my password in the code.
I am using IIS smtp mail and VS 2003
Also noted below, I have an outlook email account (the first one below password and name changed )
and a msn.com email account
The outlook email account works but the msn account does not?
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
'newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "kenn@dtyinc.net")
'newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "Password")
'SmtpMail.SmtpServer = "mailserver"
SmtpMail.SmtpServer = ""
newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
'newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "kenn@msn.com")
'newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "welcome")
'SmtpMail.SmtpServer = "mailserver"
SmtpMail.SmtpServer = ""
|
|
|
|
|
when i execute following code then it save two record instead of one.....
Imports System.Data
Imports System.Data.Odbc
Partial Class Category
Inherits System.Web.UI.Page
Public x As Integer
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ConnStr As String = "Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=AgentImg;uid=root;pwd=;option=3"
Dim con As OdbcConnection = New OdbcConnection(ConnStr)
Dim str1 As String
Dim ad As OdbcDataAdapter = New OdbcDataAdapter()
If (Option1.Items(1).Value = 1) Then
str = "insert into Category(id,Category_Name,Category_Price,Category_Img,Category_Desc,Category_header) Values('','" & TextBox1.Text & "', '" & TextBox2.Text & "','" & FileUpload1.FileName & "','" & TextBox4.Text & "','" & TextBox5.Text & "' )"
Else
str = "insert into Category(id,Category_Name,Category_Price,Category_Img,Category_Desc,Category_header) Values('','" & TextBox1.Text & "', '' ,'" & FileUpload1.FileName & "','" & TextBox4.Text & "','" & TextBox5.Text & "' )"
End If
Dim InsCom As OdbcCommand = New OdbcCommand(str1, con)
con.Open()
InsCom.ExecuteNonQuery()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
con.Close()
End Sub
Protected Sub RadioButtonList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Option1.SelectedIndexChanged
If (Option1.Items(0).Selected = True) Then
x = 1
TextBox2.Enabled = True
End If
If (Option1.Items(1).Selected = True) Then
x = 2
TextBox2.Enabled = False
End If
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
End Class
i have set the autopostback property true of optionlist1.
please give the suggstion.
|
|
|
|
|
Where do you declare the variable str, and what value do you put in it?
---
b { font-weight: normal; }
|
|
|
|
|
i have declare the str variable in the local module that is in button
click(). i'm storing the sql query in the str variable.
|
|
|
|
|