|
Dear gurus,
I want to make a statistics on the words of any text within a pdf-file.
Do you know how I can access a pdf for my purpose?
thanks in advance
|
|
|
|
|
Hint: try to search CP articles containing the word pdf.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi all,
I am reandering a Data Grid from my web part containing a paging event its giving me post back but grid is rendering twise on the page.
Any suggestion???
<br />
protected override void CreateChildControls()<br />
{<br />
DataTable data = null;<br />
string[] columnArray = null;<br />
bool IsColumns = false;<br />
DataTableValidationStatus tableStatus;<br />
<br />
try<br />
{<br />
if (!String.IsNullOrEmpty(Columns))<br />
{<br />
columnArray = Columns.Replace(" ", "").Split(',');<br />
IsColumns = true;<br />
}<br />
<br />
data = GetDataTable();<br />
tableStatus = Utility.ValidateDataTable(data, true, true, IsColumns, columnArray);<br />
<br />
if (tableStatus == DataTableValidationStatus.Valid)<br />
{<br />
data.Locale = System.Globalization.CultureInfo.InvariantCulture;<br />
<br />
grid.EnableViewState = true;<br />
grid.AutoGenerateColumns = false;<br />
grid.AllowPaging = true;<br />
grid.PageSize = PageSize;<br />
grid.CurrentPageIndex = currentpageindex;<br />
grid.PagerStyle.Mode = PagerMode.NextPrev;<br />
grid.PagerStyle.CssClass = PagerStyleCssClass;<br />
<br />
grid.CssClass = GridCssClass;<br />
grid.AlternatingItemStyle.CssClass = AlternatCssClass;<br />
grid.HeaderStyle.CssClass = HeaderCssClass;<br />
grid.ItemStyle.CssClass = ItemCssClass;<br />
<br />
grid.Width = System.Web.UI.WebControls.Unit.Percentage(100);<br />
<br />
grid.PageIndexChanged += new DataGridPageChangedEventHandler(this.grid_PageIndexChanged);<br />
<br />
grid.DataSource = data;<br />
grid.DataBind();<br />
Controls.Add(grid);<br />
}<br />
}<br />
<br />
private void grid_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)<br />
{<br />
currentpageindex = e.NewPageIndex;<br />
BindGrid();<br />
}<br />
Anuj
|
|
|
|
|
Hi All,
I want to use the outlook application in my program i want to use it's option without opening it.
I hear about a line code but i need more help about that.
merwa
|
|
|
|
|
Here's[^] an example on MSDN of how to use MS Outlook in C#.
|
|
|
|
|
in remoting, the choice of the channel for intranet application without firewall protection or allowing communication thru some port, is mostly TCP.we can achieve our functionality by http channel as well.but by using TCP we get performance gain since TCP is faster than HTTP.
Can anyone clarify why communication over TCP channel is Faster than on Http channel
|
|
|
|
|
|
I am try crypt and decrypt the same text. I am use a symetric algorithm (Rijndael), but I don´t understand what happend whit my code. This is the test.
1. I write a text in a textbox (txtSrc).
2. I read the text, crypt it and write it in a label (lblCph1).
3. I read the text in the label and again crypt it y write the result in other label (lblCph2).
In the point 2, I expect the text of the label with strange simbols (cipher it), and in the pint 3 I expect the text of the label in plain text, but it is in strange simbols too. I don´t undertand, I think what if I crypt a text with the same key a pair of time, it will be decrypted. ¿Someone can explain to me?
I have write a example code.
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
using System.Security.Cryptography;<br />
using System.IO;<br />
<br />
namespace PruebaSimetrica<br />
{<br />
public partial class Form1 : Form<br />
{<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
<br />
private void btnCph1_Click(object sender, EventArgs e)<br />
{<br />
byte[] RellenoKey = new byte[] { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF };<br />
byte[] RellenoIV = new byte[] { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF };<br />
Rijndael RijndaelAlg = Rijndael.Create();<br />
RijndaelAlg.Key = RellenoKey;<br />
RijndaelAlg.IV = RellenoIV;<br />
byte[] bytePlainText = Encoding.Default.GetBytes(txtSrc.Text);<br />
byte[] byteCryptText;<br />
<br />
bytePlainText = Encoding.Default.GetBytes(txtSrc.Text);<br />
<br />
MemoryStream mStream = new MemoryStream();<br />
CryptoStream cStream = new CryptoStream(mStream, RijndaelAlg.CreateEncryptor(RijndaelAlg.Key, RijndaelAlg.IV), CryptoStreamMode.Write);<br />
<br />
cStream.Write(bytePlainText, 0, bytePlainText.Length);<br />
cStream.FlushFinalBlock();<br />
<br />
byteCryptText = mStream.ToArray();<br />
<br />
lblcph1.Text = System.Text.Encoding.Default.GetString(byteCryptText);<br />
<br />
cStream.Close();<br />
mStream.Close();<br />
}<br />
<br />
private void btnCph2_Click(object sender, EventArgs e)<br />
{<br />
byte[] RellenoKey = new byte[] { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF };<br />
byte[] RellenoIV = new byte[] { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF };<br />
Rijndael RijndaelAlg = Rijndael.Create();<br />
RijndaelAlg.Key = RellenoKey;<br />
RijndaelAlg.IV = RellenoIV;<br />
byte[] bytePlainText ;<br />
byte[] byteCryptText=Encoding.Default.GetBytes(lblcph1.Text);<br />
<br />
byteCryptText = Encoding.Default.GetBytes(lblcph1.Text);<br />
<br />
MemoryStream mStream = new MemoryStream();<br />
<br />
CryptoStream cStream = new CryptoStream(mStream, RijndaelAlg.CreateEncryptor(RijndaelAlg.Key, RijndaelAlg.IV), CryptoStreamMode.Write);<br />
<br />
cStream.Write(byteCryptText, 0, byteCryptText.Length);<br />
cStream.FlushFinalBlock();<br />
<br />
bytePlainText = mStream.ToArray();<br />
<br />
lblCph2.Text = System.Text.Encoding.Default.GetString(bytePlainText);<br />
<br />
cStream.Close();<br />
mStream.Close();<br />
}<br />
<br />
}<br />
}
Thanks,
Fernando
|
|
|
|
|
To return encrypted text to plain text use CreateDecryptor().
|
|
|
|
|
Yes, it is true, they finally work.
I was a week doing changes.
Thank
Fernando
|
|
|
|
|
Dear All
Regards!
I have a program that opened and read a DXF file format in C# and then draw all the entities in DXF file using openGL, but i can't read the color of these entities which are given in DXF file,
so need program in C# to read the color of each entity i.e circle, polyline,arc etc..,of DXF file and then draw each entitiy i.e circle, polylines etc, in that specific color, as for each entity there is color in DXF file.
kindly help me while writng program for it.
Thanks
David
david
|
|
|
|
|
hey,
i'm writing a hardware lock for my new tailor made software,
my approch is,
For every DML i'll check for the existance of hardware lock,
for this i'll query the hardware to send me some GUID,
comapre this GUID with one from software side,
if it matches then continue else stop
(the hardware for this will be designed according requirments given)
now questions :->
Should i use serial port or usb ? (in terms of processing time)
use a function to generate this GUID ?(well i will surely do tht, but whts the general practice/ algorithm)
will this ID be machine dependent?
becoz what i want is one installation CD with one hardware lock which can work on any machine?
give me an idea, as i'm thinking tht it wont be as simple as wht i'm thinking
regards,
logicaldna
|
|
|
|
|
I will answer the hardware part only:
it has to be USB, since a modern PC (desktop or laptop) has 2, 4, 6 or more USB ports
and often 0 serial ports.
furthermore, if I need several hardware locks, its much easier to add USB ports (using
a USB hub), than it is to add serial ports.
and lastly you can easily have USB ports at a distance, such as the USB ports found on
many desktop monitors.
The performance issue AFAIK is irrelevant since an app will typically check the hardware
lock only once (at startup), or a couple of times (when saving something),
certainly not all the time.
BTW there are companies such as WIBU[^] that sell
USB hardware locks; they are organized in such a way
that they can hold a number of keys plus a couple KB of app data; so a new software
can be linked to either an existing key or a new, empty key, and that is how it should be.
And of course, companies that offer hardware keys also have the necessary software
to support them, including an API to integrate it in the app itself.
To sum it up, whatever your software product is going to be, if it comes with a
serial port hardware lock I wont buy it. If it works with a USB key, it better be
from a trusted hardware source and able to combine with other protected packages...
So I dont see the point in reinventing stuff that exists and performs well.
|
|
|
|
|
Luc Pattyn wrote: So I dont see the point in reinventing stuff that exists and performs well.
cost !
i have resources which will give me the hardware and i can write software, if i do it neatly,then i have something to sell :->
you won't belive, but i might have to install software on machines where they dont have USB port
so now i'm thinking of putting a switch as it should work on both (serial and USB)
thanks anyways !
regards,
logicaldna
|
|
|
|
|
Hi,
I need to export data from DB (SQL Server 2005) to a file (eg. Excel, text file or any other format, .CSV) at the same time preserving the rows and column schema of the DB. Then I need to zip it and mail it across to a mail id.
One approach is to use File object to create a text or excel file, but the data will be scrambled when it will be written on to the file.
I need to do all this programmatically.Please help.
|
|
|
|
|
Why not use the "FOR XML" with the SELECT statment? This way you get a XML representation, which could be saved to file etc etc.. ?
|
|
|
|
|
hi, I have a login window that opens up before any other window of the application. the problem is that I m not able to close the login window upon authentication and then load the parent window of the system.
I use the following code to hide the login window:
this.FindForm().Visible=false;
but hiding the window is a very bad approach as though the form is not visible but it still is consuming memory.
the following code to close the window closes all the windows of the application, including the MDI parent form
this.FindForm().Close();
Please help
|
|
|
|
|
Use MDI container , open the login as the child of tht MDI, on successful login close the form as its a child it wont close the parent, open a new form which you want to show !
does tht help ?
regards,
logicaldna
|
|
|
|
|
|
Hi,
There is simple approach to this problem create MDI form
and on MDI Form_load event
formLogin.Showdialog() --for .Net--
OR
formLogin.show(vbmodal) --for VB classic--
[ remember formLogin is not a child Form ]
and At Last on Successful Login Close formLogin.Close
Thanks & Wishes
Navneet Hegde
Nashik(City Of Pilgrimage)
Develop2Program & Program2Develop
|
|
|
|
|
I set "DrawMode = OwnerDrawText, checkboxes = false, StateImageList = myImageList " .
When the treeview show, the nodes are to get tightly.
The same for it that space between text and Image.
How to augment space between?
Thank you.
|
|
|
|
|
I know there is no Membership API for windows forms application. But if anybody can give some idea about where similar applications can be found fro windows forms application.

|
|
|
|
|
I am afraid the answers today will be the same the were last week.
|
|
|
|
|
Didn't you ask this question last week? MS hasn't magically added them over the weekend.
|
|
|
|
|
Hi,
I' ve a custom drawn panel similar to groupbox(with nice round borders and header text) . I would like to change it's dock bounds (offset it a little bit), so that when a control is docked inside my custom control, it won't overlay my custom drawn border and header text. I know there is a hidden property which handles dock bounds (can't remember it's name) or maybe changing the client area would help ?
thanx
Stevo
|
|
|
|
|