|
When I need to convert video formats, I execute an external process called ffmpeg. That's the best shortest way to do what you're trying to do.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi all,
I've a string in rtf format and I want to get plain text from there. But the rtf string is in Unicode and additional space is there after each character. It cause to get the pain text from RichTextBox. How can I solve this matter?
Thanks a lot
I appreciate your help all the time...
CodingLover
|
|
|
|
|
It sounds like you have a string encoded as UTF-16 , and decode it using a different encoding. Each chatacter is two bytes, so for all regular characters every second byte is zero.
Use the Encoding.UTF16.GetString method to decode the data into a string.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
HI,
This is from Chandrakanth working on C#.net with Asp.net with SharepointMOSS 2007.
Actually we are updating data into DataBase by clicking button.
And some of scanned files are going to store in Application Directory.
That name of the application directory is TiffFiles.
Actually the process goes in this below format.
1) We are entering user credential for Login.
2)We are selecting one folder from DROPDOWN. That folder contain Scanned files.By clicking BUTTON RETRIVEDATA the data will be going to store in DataBase, and Files are going to store in TIFFFOLDER.That Folder in Application.
2) And by Clicking WORKFLOW BUTTON the files should move to Folder in Sharepoint Server.The Name of the Folder in Sharepoint Server is SCANNED FILES.
Now the Problem is FILES are not moving to Folder in Shrepoint Server.
Here i am giving code and all. Can any one tell me how to Solve the Problem.
private void readdata(string batch)
{
string strConnection = (string)ConfigurationSettings.AppSettings["ConnectionString"];
SqlConnection con10 = new SqlConnection(strConnection);
SqlCommand cmd10 = new SqlCommand();
cmd10 = new SqlCommand("select * from T_Invoice_Data where BatchName='" + batch + "'", con10);
con10.Open();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
da = new SqlDataAdapter(cmd10);
da.Fill(ds, "T_Invoice_Data");
DataTable dt;
dt = ds.Tables[0];
for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
{
DataRow dr = dt.Rows[i];
string x = dr[0].ToString();
string x1 = dr[1].ToString();
string x2 = "Invoice4.TIF";
string x2 = dr[2].ToString();
string x3 = dr[3].ToString();
string x4 = dr[4].ToString();
string x5 = dr[5].ToString();
string x6 = dr[6].ToString();
string x7 = dr[7].ToString();
string x8 = dr[8].ToString();
string x9 = dr[9].ToString();
string x10 = dr[10].ToString();
string x11 = dr[11].ToString();
SPSite msite = new SPSite("http://sys245:44486/ScanDocuments");
SPWeb mweb = msite.OpenWeb();
mweb.AllowUnsafeUpdates = true;
string path = @"c:\AuroBindoUsingGoogleOCR\Tiffiles\";
string path2 = path + x;
if (File.Exists(path2))
{
FileStream fStream = File.OpenRead("C:\\AuroBindoUsingGoogleOCR\\Tiffiles" + "\\" + x);
fStream.Read(fileContent, 0, (int)fStream.Length);
fStream.Close();
SPListCollection splist = mweb.Lists;
SPList splis = splist["ScanDocuments"];
string createddate;
createddate = Convert.ToString(DateTime.Today.Day + "_" + DateTime.Today.Month + "_" + DateTime.Today.Year);
splis.RootFolder.SubFolders.Add(x6);
SPFolderCollection folders = mweb.GetFolder("http://sys245:44486/ScanDocuments/" + x6).SubFolders;
folders.Add(createddate);
SPFolderCollection folders2 = mweb.GetFolder("http://sys245:44486/ScanDocuments/" + x6 + "/" + createddate).SubFolders;
folders2.Add(batch);
SPFileCollection f02 = mweb.GetFolder("http://sys245:44486/ScanDocuments/" + x6 + "/" + createddate + "/" + batch).Files;
f02.Add(x, fileContent, true);
SPSite msite1 = new SPSite("http://sys245:44486/");
SPWeb mweb1 = msite.OpenWeb();
mweb1.AllowUnsafeUpdates = true;
SPList list = mweb1.Lists["ScanDocuments"];
SPListItemCollection items = list.Items;
foreach (SPListItem item in items)
{
string l1 = item.Name.ToString();
if (l1 == x)
{
item["FileName"] = x;
item["InvoiceNo"] = x1;
item["InvoiceDate"] = x2;
item["PO NO"] = x3;
item["TotalAmount"] = x5;
item["Location"] = x6;
item["Batch"] = x7;
item["CStaff"] = x8;
item["AssignedTo"] = x9;
item["DelFlag"] = x10;
item["ReOCRFlag"] = x11;
item["PODate"] = x4;
item.Update();
}
}
}
}
}
Thanks and Regards
Chandrakanth
|
|
|
|
|
Hi Friends,
In my project, I am able to call server side function from javascript in which i am inserting data in DropDownList,But the DropDownList is not showing the data. I am using C#.net .
Regards,
Atul Rane
|
|
|
|
|
I'd say you have two issues
1 - you're not asking in the right forum
2 - your code is broken.
Your error is hard to point out when you didn't post any code.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I created small application of BHO in c# using http://www.codeproject.com/KB/cs/Attach_BHO_with_C_.aspx?fid=447248&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=51&select=2421069
I want to change the web page text totally on page loading, and i want the changed content should be seen by user directly instead of original text.
How can I do this?
In the following link http://msdn.microsoft.com/en-us/library/aa752299(VS.85).aspx
it has given that, we can change the value of the title element using the document.title property and to change the content of a particular cell, use the IHTMLElement::innerHTML property.
I was changing the title element as it is, but How can I change the element's text present in document.body?
Any suggestion can be appreciated...
actually, I was changing the individual element's text with the help of IHTMLElement::innerText property, but the original text is visible to user for a fraction of second and then the original content is replaced by other text. i.e., there is some delay in replacing the original content, how can I avoid this?
I want the changed content should be directly visible to user.
I had already posted it in .Net framework forums...
I think this is the right forum to this
|
|
|
|
|
|
1.listen the mouse click and move events.
2.Check the method - RotateTransform of Graphic object. E.g.
gfx.RotateTransform(rotationAngle);
I Love KongFu~
|
|
|
|
|
Hi,
I have a DataGridView that displays the UserID and FirstName. I want to change the FirstName to a LinkLabel so that when the user click the firstname a second form will popup with the details of that user.
For example:
When I click test1 it should display the ID and firstname of test1 in form 2.
Can anyone shed some light on this? I have been able to add the linkcolumn but how can I pass the needed variables to retrieve the records?
Thank you!
Illegal Operation
|
|
|
|
|
If you haven't done so already you would want to set your gridview to not auto generate the columns.
Example:
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" xmlns:asp="#unknown">
Within the GridView declaration, declare a <columns> element.
Within the Columns element, define the <asp:hyperlinkfield> you intend to display, specifying at the very least the required DataTextField and DataNavigateUrlFields properties.
Optionally set the HyperLinkField control's other properties, such as the HeaderText and DataNavigateUrlFormatString. For syntax, see GridView Control Syntax.
Example:
<columns><asp:hyperlinkfield headertext="User" datatextfield="UserName" datanavigateurlfields="UserName" datanavigateurlformatstring="hostmysite.com">
Also you can check out the msdn which provides a lot of helpful information for the gridview. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx[^]
Matthew Vass
QA Analyst
mvass@hostmysite.com
http://www.hostmysite.com?utm_source=bb[^]
|
|
|
|
|
|
Hi
I am attempting to use FileSystemWatcher but get an error at 'OnChange' in the code following.
I've referenced System.IO but there is still something I am missing.
Help would be much appreciated.
Bob
private FileSystemWatcher _fileWatcher;
internal void InitializeWatcher(FileInfo configurationFile, IList<string> configurationSections)
{
_fileWatcher = new FileSystemWatcher
{
Path = "C:\\IDW32\\Library",
Filter = "P&ID.txt",
NotifyFilter = (NotifyFilters.CreationTime | NotifyFilters.LastWrite |
NotifyFilters.FileName)
};
_fileWatcher.Changed += OnChange;
_fileWatcher.EnableRaisingEvents = true;
|
|
|
|
|
An error? What error? They tend to fairly informative so do tell us.
Alan.
|
|
|
|
|
The error message would be most useful, as would the code for the OnChange event handler. Without either there is little we can do to help.
|
|
|
|
|
Sorry
Error message - 'does not exist in the current context'
Bob
|
|
|
|
|
And the code in the OnChange handler? Please also indicate the line of the code where the error occurs - we are not mind readers.
|
|
|
|
|
Hi Colin
I beleive I did indicate the error involved "OnChange" in the expression
_fileWatcher.Changed += OnChange;
Perhaps it wasn't clear.
Here is what I have, so far, for the event handler
public event FileSystemEventHandler Changed;
_sharpMap.RefreshMap();
Bob
|
|
|
|
|
Oh! It is a COMPILER error. It isn't a RUNTIME error in the OnChange method.
Your error is saying that OnChange doesn't exist. You need to create a method called OnChange with the appropriate signature. (i.e. the parameters that the Change event handler is expecting to pass)
Bob Pawley wrote: Here is what I have, so far, for the event handler
public event FileSystemEventHandler Changed;
Doesn't the FileWatcher have events for you to subscribe to? If you create your own then you have to trigger them.
|
|
|
|
|
When you type this line:
_fileWatcher.Changed += OnChange;
You'll find that just after you type the += part that Intellisense offers to complete the line for you (assuming you typed the first part correctly) if you press the tab key. It first of all completes the line and on the second press of tab it will create a method stub for you. That way everything is created and connected up properly very quickly.
|
|
|
|
|
Hi to all,
I am new in this forum. I was searching help about a recent problem i have got with filestream object.
Specifically I have the need that two or more users read and write a file content and so I coded these lines of code:
. . .
. . . this code is in a function.. for simplicity I reported a snippet
public enum dbLockType { _none =0, _lock, _unLock, _default}
long lockPos = -1;
long lockRec = -1;
int blockSize = 100;
FileStream DtFile = new FileStream(@"\\server\d\folder\test.txt", FileMode.Open, FileAccess.ReadWrite,
FileShare.ReadWrite,8000);
. . .
. . .
public bool getBufferFromDisk(long RecordNumber, byte[] toArray, int startingAt, int length, dbLockType dbLock)
{
long seekPosition = GetFilePos(RecordNumber);
try {
DtFile .Seek(seekPosition, System.IO.SeekOrigin.Begin);
DtFile .Read(toArray, startingAt, length);
if ( dbLock == dbLockType._lock) {
if ( lockPos > -1)
DtFile .Unlock(lockPos, blockSize);
DtFile .Lock(seekPosition, blockSize);
lockPos = seekPosition;
lockRec = RecordNumber;
}
}
catch(IOException e) {
return false;
}
return true;
}
After that the first user open the file and call the getBufferFromDisk with these parms:
getBufferFromDisk( 8, toArray, 0, 100, dbLock);
in this way it lock the filestream at pos (7 x100) for 100 bytes.
the second user try to open the file and to execute the same function with these parms:
getBufferFromDisk( 0, toArray, 0, 100, dbLock);
at this point I got an error telling me that the file is partially locked by other process.
I found the prorblem occur at this line :
DtFile .Read(toArray, startingAt, length);
Stange , because I have locked 100 bytes starting from pos 700 not at 0.
After some reading I found this article that seems more like my problem :
So I tried to go further and after some investigation I found :
1. Even though I change the FileAccess to .Read the second user find the record at pos 0 locked.
2. the lock is extended to the whole buffer , that is 8K.
3. all this is true if the second user try to open and read something in this buffer if something in this buffer is locked otherwise all is ok!, I mean if the first user lock something at pos 8500 , 100 the second user has no problem at all.
What is this , a bug? Am I wrong in something ? this is the correct way to lock-unlock regions ?.
Could someone help me to get rid of this problem ?
Thanks to all ?
JossGP
modified on Monday, February 2, 2009 5:01 AM
|
|
|
|
|
|
You might want to edit your post and correct the terminating </pre> so that the remainder of your post word wraps correctly.
|
|
|
|
|
Thank you ,Colin . I didn't see while I was typing.
How I can do that? , I don't see any edit option on bottom's post.
|
|
|
|
|
It is on the bottom right of your post.
|
|
|
|