|
Yup...that will get me headed in the right direction. Thank you very much.
|
|
|
|
|
Hello Every 1.
I have a strange problem with webclient. I have the following method in a class created to download files from a website. I download files sequentially i.e download one file dispose the download class object then create a new object and call the download method and so on....
public void DownloadVideo()
{
try
{
WebClient wcDownload = new WebClient();
webRequest = (HttpWebRequest)WebRequest.Create(_VideoUrl);
webRequest.Credentials = CredentialCache.DefaultCredentials;
webResponse = (HttpWebResponse)webRequest.GetResponse();
if (webResponse.ResponseUri.ToString() != "http://www.xyz.com/error.htm")
{
Int64 fileSize = webResponse.ContentLength;
strResponse = wcDownload.OpenRead(_VideoUrl);
strLocal = new FileStream(_VideoPath, FileMode.Create, FileAccess.Write, FileShare.None);
int bytesSize = 0;
byte[] downBuffer = new byte[2048];
while ((bytesSize = strResponse.Read(downBuffer, 0, downBuffer.Length)) > 0)
{
strLocal.Write(downBuffer, 0, bytesSize);
UpdateVideoProgressEventArgs uvpea = new UpdateVideoProgressEventArgs(strLocal.Length, fileSize);
UpdateVideoProgressEvent(this, uvpea);
}
}
}
catch (Exception exp)
{
MessageBox.Show("Error in startDownload due to : " + exp.Message);
}
finally
{
if (strLocal != null)
strLocal.Close();
if (strResponse != null)
strResponse.Close();
webRequest = null;
webResponse = null;
}
}
It works fine for the first file download but fails for the second file because it just hangs up @
strResponse = wcDownload.OpenRead(_VideoUrl);
and eventually time out.
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
Here i am facing a problem
I m displaying a gridview data in that i want the sno is automatically to be generated for each and every row the grid is binding
can any one pls help me
Thanks in advance
sai krishna
|
|
|
|
|
|
such create a dummy cloumn and assign current row index value to the column...that's it..my friend
|
|
|
|
|
i only got it
<
asp:TemplateField HeaderText="Item Count">
<itemtemplate>
<%#Container.DataItemIndex + 1%>
Thanks
sai krishna
|
|
|
|
|
welcome...
|
|
|
|
|
hai Friend,
Please show how to edit / Insert the text to a csv file at middle
when multiuser working with the same file
kannan.R
kannan_chinna@email.com
|
|
|
|
|
RamasamyKannan wrote: when multiuser working with the same file
That's not really possible. If your users write to the same file, either they will do it at the same time and one will fail, or the last one to write, will win, and all changes are lost. Unless you were to do some sort of diff and merge in any changes that occured with your own changes, which is complex.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
I've never heard of it, but I still found it with google, in seconds.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
There[^] you go. Enjoy.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi All.
In AD i have two users - u1 and u2. I want to check - has user u1 rights to update some attributes of user u2.
how i can check it in C# 2.0, framework 2.0 ?
|
|
|
|
|
hi all
i am inserting date to the text box on the datagrid template.There is 2 column for that. one receive date and the other due date. due date should be greater than receive date. and the date format is dd/mm/yyyy. how to validate this. since the date format is dd.mm.yyyy, am not able to compare it with different month.plz help me to solve this. am doing this from past 4 days. but didnt end up with a solution
sample code is given below
if(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text != "")
{
try
{
DateTime txt=Convert.ToDateTime(((TextBox)(dgDetailData.Items[total].Cells[6].Controls[1])).Text);
DateTime tst=Convert.ToDateTime(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text);
string date=month+"/"+day+"/"+year;
if(DateTime.Compare(txt,tst)>0)
{
lblmsg.Text="error";
lbl1.Text=date.ToString();
}
else
{
lbl1.Text=txt.ToString();
InsertParam[9].Value=Production.FORMATYMONDTIME(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text);
}
}
catch(Exception err)
{
RegisterStartupScript("startup","<script>window.alert('1.Error:"+err.ToString()+"')</script>");
}
}
else
{
InsertParam[9].Value=DBNull.Value;
}
-- modified at 22:46 Thursday 4th October, 2007
|
|
|
|
|
P_Elza wrote: since the date format is dd.mm.yyyy, am not able to compare it with different month
Why not ?
if (txt > tst)
should work just fine.
What's going wrong with this code when you step through it now ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello guys,
is there any way, how can I change IP address and other network settings programmatically ? [using C#, or unmanaged C++].
thanks in advance
VirtualVoid.NET
|
|
|
|
|
Dear all,
Is there a way to put the cursor say Hourglass to appear on form? Like the Disk Defragmenter in Vista, when you click on the "Defragment now" button, an hourglass will be shown at the side of the label "Defragmenting hard disks...".
Additionally, in IE7, while a web page is loading, you can see an hourglass cursor on the edge of the tab.
Many thanks!
|
|
|
|
|
It won't be a cursor, but you can draw anything you like on your form.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
try put image there with some properties like "visible" which will be set to true (and then displayed) when some action is processed
VirtualVoid.NET
|
|
|
|
|
Set Form.Cursor=Cursors.WaitCursor and hover the form...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi
I want to use circular buffering technique for transmission of video over LAN.But I m not getting help in its implementation in C#.Plz if any1 did work with this technique then Help me Out.
Thanx.
Shanzay
|
|
|
|
|
Is google broken where you are?
It works fine[^] for me.
|
|
|
|
|
Ofcourse At 1st I searched there but didnt get exact info. related to LIVE video then asked.THANX.
Shanzay
|
|
|
|
|
hai, I've got question about RTB Controller in C#
I need to "hide" some of text in RTB Controller. I'm thinking of using TreeView Controller so if the user wants to "unhide" they just expand the treeview.
is it possible to add another control like treeview controller in RichTextBox?
if not possible, is there another way to hide some text in RTB Controller?
regards
~erwin~
Mail me at erwin@holyknight.us
|
|
|
|
|
Hi All,
I’m new to C#, however I’m willing to learn it everyday. I'm trying to create a simple program that will run in console mode. Below is the objective and what I have done so far.
Objective:
To check if the remote host are online in the network resolved by using WINS lookup and sent ping request to get reply status, using ip address get from nblookup.exe. I manage to get first part run. Now I want to process the output of the "nblookup.exe" and get the ip address in a variable to use later in ping command.
Can anybody kindly guide me on how to do this? Really appreicate your help in advances. Thanks
regards,
dinidamia
My Sample Code:
-------------------------------------------------------
using System;
using System.Diagnostics;
namespace program
{
class program
{
// args[0] must be hostname.
static void Main(string[] args)
{
if (args.Length == 0)
{
//If user did not enter any Parameter inform him
Console.WriteLine("Usage : program <hostname> ");
return;
}
else
{
string sUserInput = args[0];
QueryWinsSrv(sUserInput);
}
}
#region
// QueryWinsSrv:
// Run nblookup.exe against remote host
// If the hostname resolved in WINS
// ping remote host using ipaddress found in WINS
static void QueryWinsSrv(string sRemoteHostname)
{
Process p_nblookup_cmd = new Process();
p_nblookup_cmd.StartInfo.FileName = "nblookup.exe";
p_nblookup_cmd.StartInfo.Arguments = "-s 10.88.8.3 " + sRemoteHostname;
p_nblookup_cmd.StartInfo.UseShellExecute = false;
p_nblookup_cmd.StartInfo.RedirectStandardOutput = true;
p_nblookup_cmd.Start();
string nblookup_cmd_output = p_nblookup_cmd.StandardOutput.ReadToEnd();
Console.WriteLine(nblookup_cmd_output);
p_nblookup_cmd.Close();
}
#endregion
}
}
-------------------------------------------------------------
Program Output:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\program.exe JOE_WXP1
Recursion is on
Querying WINS Server: 10.88.8.3
NetBIOS Name: JOE_WXP1
Suffix: 20
Name returned: JOE_WXP1
Record type: Unique
IP Address: 10.88.8.20
|
|
|
|