|
Hi,
I am a new user of iTextSharp(Ver 4.1.2). I am using this dll with ASP.NET 2.0. I am able to convert a text file to PDF and also able to password protect it. Now I am trying to implement signing the converted PDF using a "security certificate"(a digital security file=x.509 V3 type).
I don't know where to start and how to proceed. Has any 1 done this before?? Please help me in getting the converted PDF signed with "security certificate". Sample code Or URL link would be much helpful.
Thanks,
DKDOTNET.
|
|
|
|
|
Hello,
my web-application must run with requireSSL="true" on the web-server. But within my local environment, I use requireSSL="false". Is there a way I can switch this on and off dynamically come deployment? "If (! System.Environemnt.MachinName.Equals("MyLocalMachine")) { ... ?
Hope to hear from you,
many thanks,
Morten
|
|
|
|
|
Hi,
I am trying to use TextReader and TextWriter to Read and Write some text files from business layer. But it is throwing permission error.
Any idea how to overcome this.
Any suggession to achieve this will do good for me.
Thanks.
|
|
|
|
|
Hi,
i would guess that the ASP.NET process (ASPNET or NETWORKSERVICE, depending on IIS version) has not the rights to access the files. If this is the problem you have to give access rights to this user.
Could you post the error message?
Regards
Sebastian
|
|
|
|
|
SeMartens wrote: i would guess that the ASP.NET process (ASPNET or NETWORKSERVICE, depending on IIS version) has not the rights to access the files. If this is the problem you have to give access rights to this user.
I think you are correct. He has to give the access right to that folder or need to change IIS Application Pool Identity of Local System .
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
I actually want to give file IO permission to a particular DLL only. i.e. my business layer Class Library. Any other dll im using in my project should not have access to read or write files on the server.
|
|
|
|
|
Anurag Gandhi wrote: I actually want to give file IO permission to a particular DLL only
Its not the code that is executing that you grant permissions to, its the USER that has the permissions, so its not possible (unless you start playing with impersonation I guess?)
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Ashfield wrote: (unless you start playing with impersonation I guess?)
I don't mind which ever way i do. But this is the requirement because I can't trust all the Dlls I am using in my project.
I will be happy to do if it is possible. May be by any setting in web.config I Guess.
|
|
|
|
|
Anurag Gandhi wrote: I can't trust all the Dlls I am using in my project.
Why? They are surely under the control of YOUR application, they aren't suddenly going to start doing things by themselves - as long as your application is properly tested I can see no risk - unless its self mutating code, in which case its a virus.
Anurag Gandhi wrote: May be by any setting in web.config I Guess.
No, impersonation is something you would need to do in code just before calling your dll. I'm not sure you really understand what you are doing. A function in a DLL is called from YOUR application, usng (normally) the same credentials as the application. It is possible to change the credentials before the call by using impersonation, BUT this is something you need to be very careful of.
If all you are wantng to do is read/write to a specific folder grant access to THAT folder only, then your application cannot write to any ther location
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
There can be a huge discussion on "Trusting on dlls". Its a personal preference.
You can see only function input and output unless you decompile it.
When you call a function, internally, it may read your system information and send it to some website or webservice apart from giving the correct result. You may never know but can be done. Even proper testing may not solve all the trust issues.
I am not saying Dlls does it. But, according to me, not having security gives hackers a good chance to attack to your server.
About Impersonation, I will google it.
Well, my problem appears to be solved by changing a setting in web.config.
<trust level="Full" originurl="" />
Ashfield wrote: do is read/write to a specific folder grant access to THAT folder only
Granting access to that folder seems to be a good option.
Thanks Bob for all you valuable feedback.
|
|
|
|
|
It seems I was making an incorrect assumption. When you said it was a dll in yur business layer I assumed it to be a dll written by you (or someone in your company), I never thought about it being a 3rd party one.
Anurag Gandhi wrote: When you call a function, internally, it may read your system information and send it to some website or webservice apart from giving the correct result. You may never know but can be done. Even proper testing may not solve all the trust issues.
True enough, but your OP was about writing to a specific folder. It doesn't matter what context you run under, this type of thing could still happen, its all about knowing the source of your dll.
Anyway, hopefully you will resolve it. Personally, I rarely use dlls from unknown/untrusted sources. If its a library type function (such as convert to pdf) then I get it from a recognised source, otherwise I usually write my own.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
HI Friends,
I need help in converting decimal number in to the form of exp
For example 1.123434234 to its exp from.
Thank You
||SnAkeBed||
|
|
|
|
|
Can anyone tell me
What is alternate for following JavaScript with asp.net functions using JQuery. pls give example..
-> Jquery function with parameters
-> window.open
-> ScriptManager.StartUpScript
-> Make JQuery function and call it from code behind.
Also how can i get intellisense support for JQuery in vs 2008 without upgrading to sp1. I donwloaded one hotfix Hotfix for Microsoft Visual Studio 2008 – KB946581 ..but it doesnt help.
|
|
|
|
|
I'm trying to a rather odd conversion: a set of wmv to FLVs transport streams. The command I'm using is:
Most of the time it works. However, some FLVs are encoded differently than others, and I sometimes get this error:
fmpeg.StartInfo.Arguments = " -i " + video + " -s 480*360 -deinterlace -ab
32 -r 15 -ar 22050 -ac 1" + mpg;
FFmpeg version Sherpya-r13537, Copyright (c) 2000-2008 Fabrice Bellard, et al. libavutil version: 49.6.0 libavcodec version: 51.57.0 libavformat version: 52.14.0 libavdevice version: 52.0.0 libavfilter version: 0.0.0 built on May 29 2008 21:35:56, gcc: 4.2.3 Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 15.00 (15/1) Input #0, asf, from 'D:\finalconverter\inputfolder\movie.wmv': Duration: 00:04:49.94, start: 5.000000, bitrate: 78 kb/s Stream #0.0: Audio: wmav2, 16000 Hz, mono, 16 kb/s Stream #0.1: Video: wmv3, yuv420p, 320x240, 58 kb/s, 15.00 tb(r) Output #0, flv, to 'D:\finalconverter\outputfolder\movie.flv': Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 200 kb/s, 15.00 tb(c) Stream #0.1: Audio: libmp3lame, 16000 Hz, mono, 64 kb/s Stream mapping: Stream #0.1 -> #0.0 Stream #0.0 -> #0.1 [libmp3lame @ 00B13560]flv does not support that sample rate, choose from (44100, 22050, 11025). Could not write header for output file #0 (incorrect codec parameters ?)
Why isn't the command working?
|
|
|
|
|
I have got stuck up with ASP.Net tree view.
Business requirement
There are parent type nodes called category (folders for example).
Child node can be category (folders) or factor (files for example) in business term. Factor cannot have child. In the sense a leaf node can be category or factor. The requirement is of different image on expand collapse of nodes for category and for leaf node which are factor they want third image, if lead node is a category then they want image that is same as expanded category.
Problem and scenario
I did some property settings to bring these images as per requirement. But the problem came in picture when I tried to add image through code for leaf nodes. The leaf node are getting indenting compared to their siblings. They are starting from other nodes text starting point ,that is the reason they are getting indented. I could not include NoExpandimageURL property for leaf node because my leaf nodes are of two types and have different images for each type. Is there any way to make this proper align?
Code written for tree view generation.
(Source file)
<asp:TreeView ID="tvwCategories" ExpandDepth="2" runat="server" CollapseImageUrl="../../_LAYOUTS/IMAGES/category.gif"
ExpandImageUrl="../../_LAYOUTS/IMAGES/CatCollap.gif" NodeIndent="15" Width="209px" BorderColor="Transparent" BorderStyle="None"
OnSelectedNodeChanged="tvwCategories_SelectedNodeChanged" NodeStyle-HorizontalPadding="5" NodeStyle-VerticalPadding="0">
hemant basvapattan
|
|
|
|
|
Hi Friends,
The following code has been used in one of the asp page to fetch data from excel sheet and insert into table. Excel Driver part is used to do this. But however the excel sheet includes more than 130 rows. But when importing it just imports only 91 row and the remaining rows are not getting uploaded in the table. Please Please help.
ExcelDriver Part:
set objConn = Server.CreateObject("ADODB.Connection")
set rsExcel = Server.CreateObject("ADODB.RecordSet")
strName = "\Uploads\bicreports\" & strFileName
servername = server.mappath(strName)
' Create a connection string.
strConnectionString = "DBQ= " & servername & _
";DefaultDir=" & SERVER.MAPPATH("/bicreports/") & _
";Driver={Microsoft Excel Driver (*.xls)}" & _
";DriverId=22;FIL=excel 8.0" & _
";ImplicitCommitSync=Yes;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5" & _
";SafeTransactions=0;Threads=3;UserCommitSync=Yes;"
Is there anything wrong with above code attributes...which forces to read only 91 rows...
Its very urgent...Please help...
Thanks lot in advance.
priyaahh
|
|
|
|
|
while I tried to publish my application I got this error "Error 60 The type 'sidemenu' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\emms\ff85cd27\e81f774b\App_Web_yukhk2wj.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\emms\ff85cd27\e81f774b\App_Web_v7eywk8x.dll'
"
as sidemenu' is a user control that I create to use
|
|
|
|
|
I had a Problem but not with a User Control, but the reason to the Problem was that i have Imported a Reference Twice. Meaning to resolve the Problem go to your References in the Solution Explorer and and Remove the Reference.
Am not sure what is happening in your case
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
i am using date time picker.i want to change the date format. currently it showing 1/23/2009 i want 1 jan,2009. its not showing date format property.it has reguler exp. "\d{1,2}\/\d{1,2}\/\d{2,4}" with it can we change the format of the date .. thnx..
|
|
|
|
|
that mean that date time picker does not allow you to change date format
why dont you use some other date time picker like gmd date picker which is free is fullfill your requirement..
umerumerumer
|
|
|
|
|
Hi guys,
I'm trying to do a file download for a user in ASP.NET. The method I'm using is writing the entire file to the Response the client gets. This approach works as expected in IE7 / Firefox / Etc. Unfortunately this approach crashes IE6. Locally on my machine (XP + IIS 5.1) it also works in IE6, but on the server machine (WIN2003 + IIS 6) it doesn't.
Response.Clear();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentEncoding = System.Text.UTF8Encoding.UTF8;
Response.Charset = "";
Response.ContentType = "application/text";
sr_File = new StreamReader(file.FullName);
Response.BinaryWrite(new BinaryReader(sr_File.BaseStream).ReadBytes((int) sr_File.BaseStream.Length));
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.Flush();
HttpContext.Current.ApplicationInstance.CompleteRequest();
sr_File.Close();
Any ideas are greatly appreciated!
Thanks!
|
|
|
|
|
From where you are getting this file? If it is not on database, all you need is to redirect to the file using Response.Redirect(FileToDownload) . You don't need all these coding.
|
|
|
|
|
That might work, but instead if I generate this file dynamically I should follow this approach that clearly doesn't work
|
|
|
|
|
I am trying to change the font size on a radio button !! i add data to the radiobutton threw a sql query. So the items are databound. But if i set the font size it stay by default 12, How will i be able to change the font size after the data has been bound to the Radio button ?
Thank you ....... i hope.
|
|
|
|
|
You might be using theme.
If yes, Do RadioButton.EnableTheming = false;
This should now work if you are setting the font-size correctly.
|
|
|
|