Hi again,
first thing you need to do if you want to code with C# you have to download the InfoPath toolkit for VS. This you can get from here:
http://www.microsoft.com/downloads/details.aspx?familyid=7E9EBC57-E115-4CAC-9986-A712E22879BB&displaylang=enI have the following method which I call from the button click events. The parameter is the textbox in which i want to write the path of the selected file:
public void getFile(IXMLDOMNode attachmentBox)
{
OpenFileDialog ofdlg = new OpenFileDialog();
ofdlg.Title = "File Browser" ;
ofdlg.InitialDirectory = @"c:\" ;
ofdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*" ;
ofdlg.FilterIndex = 2 ;
ofdlg.RestoreDirectory = true ;
if(ofdlg.ShowDialog() == DialogResult.OK)
{
attachmentBox.text = ofdlg.FileName;
}
}
With the file now in your textbox you can use this as a datasource for your hyperlink.
Let me know if you need more support.
Jerome