Hi Leslie,
Welcome to the MSDN newsgroup.
From your description, I understand you've developed an .NET winform
control which is hosted in a web page(IE hosted), the control will access
files in the client computer's user profile local temp dir. However, you
find that the client runtime will always report "Could not find a part of
the path ......" exception, correct? If anything I missed, please feel free
to let me know.
Based on my experience, for IE hosted .net winform control, the most
important thing is configuring the client-side .NET runtime's CAS
permission if our control will access any particular sensitive or protected
resource on the client machine. And based on the error info you provided, I
don't think it is likely a permission issue but like the path is not a
valid one so that the System.IO api can not find the correct path. so I
suggest you try accessing a uplevel folder to see whether the control can
access it(make sure the path is valid). e.g:
=========================
private void btnTest_Click(object sender, System.EventArgs e)
{
string path = @"C:\Documents and Settings\username\Local
Settings\Temp";
DirectoryInfo di = new DirectoryInfo(path);
FileInfo[] files = di.GetFiles();
MessageBox.Show( files.Length.ToString());
}
============================
'
In addition, if you want to check whether the problem is related to CAS
permission setting, you can try using the "caspol.exe" tool to turn off the
client machine's .NET CAS checking temporarily and test it to see whether
the problem remains( if remains, it is not due to CAS setting):
#Code Access Security Policy Tool (Caspol.exe)
http://www.yqcomputer.com/
l/cpgrfcodeaccesssecuritypolicyutilitycaspolexe.asp
BTW, since the IE hosted winform control will always be hosted in the
latest framework installed on the client machine, you should use the caspol
under the framework of correct version's folder.
Hope this helps. If there is anything else we can help, please feel free to
post here.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)