|
Hello,
i have no problem to start a presentation by an c#-program (interop), but i need to navigate to slides by an externel source (via serial-interface).
Is there a way to "call" a special slide via PowerPoint-automation?
Heiko
|
|
|
|
|
I'm running a little code that should write code to a text file within the application directory, however I'm getting the following error:
Access to the path c:\inetpub\wwwroot\MapFile\Mapped.txt is denied
I'm logged on as Administrator on Windows Server 2008 and running VS 2008 SP1 / .NET 3.5.
Any ideas?
Jon
|
|
|
|
|
Navigate to that folder, view the properties -> security. Give Users write permissions.
|
|
|
|
|
This can also come up if the file has already been opened somewhere else in your code and you've forgotten to close it.
|
|
|
|
|
If this is an ASP.NET application, the accout you're using to run this code under the debugger doesn't matter. It's actually running under the ASPNET account, which IIRC, by default, does not have Write permissions to the application folder. In order to make this work, and I do NOT recommend this, you have to give the ASPNET account Write permissions to the C:\inetpub\www\MapFile folder.
|
|
|
|
|
Yeah I thought so, but what is the ASP.net acct used? When checking the users on the OS there were none other than the Administrator and another one created by sql server.
This is not a production environment, so I'm not worried about security, but it's good to know.
Jon
|
|
|
|
|
jon_80 wrote: but what is the ASP.net acct used?
Depends on the server being used. If it's the development web server that comes with Visual Studio, it's "ASPNET". If it's IIS 6.0 and below, it'll probably be something like "IUSR_machineName". For IIS 7.0 and above, I think this name got changed to just "IUSR".
|
|
|
|
|
This method should work for you.
public static void AddFileSecurity(string FileName, string Account, FileSystemRights Rights, AccessControlType ControlType)
{
try
{
// Create a new FileInfo object.
FileInfo fInfo = new FileInfo(FileName);
// Get a FileSecurity object that represents the
// current security settings.
FileSecurity fSecurity = fInfo.GetAccessControl();
// Add the FileSystemAccessRule to the security settings.
fSecurity.AddAccessRule(new FileSystemAccessRule(Account,
Rights,
ControlType));
// Set the new access settings.
fInfo.SetAccessControl(fSecurity);
}
catch (Exception exp)
{
Console.WriteLine(exp.Message.ToString());
Console.Read();
}
}
You can use it with something like this:
FileWritePermission.AddFileSecurity(path, "everyone", System.Security.AccessControl.FileSystemRights.FullControl, System.Security.AccessControl.AccessControlType.Allow);
Cheers
|
|
|
|
|
Cute code, but an account (and core running under that account) cannot grant more permissions to itself, nor anyone else, than it already has.
|
|
|
|
|
Good morning everybody,
I would like to show stocked data in ListView to send DataTable aprés Select. DataTable contains a colonne of type Byte [] Array, I do not succeed show pictures in gate.somebody address can help me SVP?
|
|
|
|
|
I think that I understand what you want to do. If I am right, this[^] link should help you.
If I am wrong, please edit your original post and try to explain you problem more clearly.
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.”
|
|
|
|
|
Good morning,
Excuse me, I am French, I speak the language badly Englishman. My question is the following:
I have one banks on look at foundation of data which contains columns Name, Forename, Photograph
I make a request SQL which is the following:
cmd.CommandText ="SELECT NAME, FIRSTNAME, PHOTO FROM USER";
I fill ListView in the following way:
sqlDa = new SqlDataAdapter();
sqlDa.SelectCommand = cmd;
try
{
sqlDa.Fill(dt_ListeUtilisateur);
if (dt_ListeUtilisateur.Rows.Count > 0)
{
lstUtilisateur.DataContext = dt_ListeUtilisateur.DefaultView;
}} //lstUtilisateur = ListView
XAML :
<listview margin="7,10,15,48" name="lstUtilisateur" itemssource="{Binding}" borderbrush="{x:Null}" listboxitem.selected="lstUtilisateur_Selected" selectionchanged="lstUtilisateur_SelectionChanged">
<listview.view>
<gridview>
<gridviewcolumn header="NAME" displaymemberbinding="{Binding Path=NAME}" selector.isselected="True">
<gridviewcolumn header="FIRSTNAME" displaymemberbinding="{Binding Path=FIRSTNAME}">
<gridviewcolumn header="Picture" width="100" displaymemberbinding="{Binding Path=MyImage}">
<gridviewcolumn.celltemplate>
<datatemplate>
In the column Picture of my ListView, I have unfortunately not the photograph but Byte [] Array you can help me please.
|
|
|
|
|
Good morning,
Excuse me, I am French, I speak the language badly Englishman. My question is the following:
I have one banks on look at foundation of data which contains columns Name, Forename, Photograph
I make a request SQL which is the following:
cmd.CommandText ="SELECT NAME, FIRSTNAME, PHOTO FROM USER";
I fill ListView in the following way:
sqlDa = new SqlDataAdapter();
sqlDa.SelectCommand = cmd;
try
{
sqlDa.Fill(dt_ListeUtilisateur);
if (dt_ListeUtilisateur.Rows.Count>0)
{
lstUtilisateur.DataContext = dt_ListeUtilisateur.DefaultView;
}} //lstUtilisateur = ListView
XAML :
<listview margin="7,10,15,48" name="lstUtilisateur" itemssource="{Binding}" borderbrush="{x:Null}" listboxitem.selected="lstUtilisateur_Selected" selectionchanged="lstUtilisateur_SelectionChanged">
<listview.view>
<gridview>
<gridviewcolumn header="NAME" displaymemberbinding="{Binding Path=NAME}" selector.isselected="True">
<gridviewcolumn header="FIRSTNAME" displaymemberbinding="{Binding Path=FIRSTNAME}">
<gridviewcolumn header="Picture" width="100" displaymemberbinding="{Binding Path=MyImage}">
<gridviewcolumn.celltemplate>
<datatemplate>
In the column Picture of my ListView, I have unfortunately not the photograph but Byte [] Array you can help me please.
|
|
|
|
|
Your English is quite good. Part of what you are trying to do, is what I thought from your first post, so it must be reasonable.
I must admit that I didn't read all of the link I gave, but I thought that it dealt with reading and saving images to and from a database. If that is not where your problem is, then can I suggest that you post in the WPF forum here on CP, as your application would seem to be a WPF one.
If loading the photo is your problem, then perhaps you might like to Google for yourself. The search term I used was 'Loading Image from SQLServer C#', to see if there is anything more appropriate.
You seem to be slightly annoyed by my suggesting that you re-word your question. You shouldn't be, I often find that trying to ask something using different words makes me understand it a little better, myself.
Anyway, Good Luck! (Bon chance ????)
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.”
|
|
|
|
|
Hi all,
I have a byte[] to unit function, I would like to have a reverse function that convert unit to byte[], please help. thanks a lot.
public static uint ParseUint(byte[] buffer, int uintLengthInBytes, ref int offset)
{
uint value = 0;
int i, j;
for (i = offset + uintLengthInBytes - 1, j = 0; i >= offset; i--, j++)
value |= (uint)(buffer[i] << (8 * j));
offset += uintLengthInBytes;
return value;
}
Regards,
unruledboy_at_gmail_dot_com
http://www.xnlab.com
|
|
|
|
|
|
hi, I know that method, the result is wrong. please take a closer look at the original code
Regards,
unruledboy_at_gmail_dot_com
http://www.xnlab.com
|
|
|
|
|
What? Is it in Big Endian or something? Just Array.Reverse the result?
|
|
|
|
|
sorry, my debugging mistake, you are right. thanks a lot.
Regards,
unruledboy_at_gmail_dot_com
http://www.xnlab.com
|
|
|
|
|
|
Byte order reversal?
Use System.BitConverter and System.Net.IPAddress.NetworkToHostOrder/HostToNetworkOrder.
One I did earlier:
internal void WriteUInt32(UInt32 i, Int32 ofs, Byte[] buffer) {
Int32 j = IPAddress.HostToNetworkOrder(unchecked((Int32)i));
Byte[] b = BitConverter.GetBytes(j);
b.CopyTo(buffer, ofs);
}
Alan.
|
|
|
|
|
Nice! I'm going to remember that one
|
|
|
|
|
present, and according to data availble as packet by packet.
I want to read the html elements obtained and change the innertext of each html element. I am able to do all these.
The main thing is I want the changed text should be visible to user directly instead of original text which is obtained in packets.
How can I do this?
If I had to use threading, How can I do that?
or If I can user timers, how can I do this?
Say correct solution. If there are any examples, it would be so much helpful for me...
|
|
|
|
|
|
the //error? line needs to be in a class definition but not inside of a function
|
|
|
|
|