|
use System.Diagonistic
<br />
Process pro = new Process();<br />
pro.StartInfo.UseShellExecute = false;<br />
pro.StartInfo.RedirectStandardOutput = true;<br />
pro.StartInfo.RedirectStandardError = true;<br />
pro.StartInfo.FileName = "Ping";
pro.StartInfo.Arguments = "ip Address" <br />
pro.Start();<br />
pro.WaitForExit();<br />
Hope it will help
|
|
|
|
|
That would launch the external ping utility. You ought to capture the output of the command. Instead of that, you can simply try the following:
www.csharphelp.com/archives/archive6.html [^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
|
I have difficulty to create a two-column website by ASP.NET, I mean the vertical menu on one column, the main content on the other. But they are on top of each other, even with Div. I don't know how to make them next to each other horizontally. I am new to ASP.NET, could anyone tell me how to create the two-column frame, please?
Much Appreciate if you help
|
|
|
|
|
|
If you want to create the DIV-based layout instead of using table-based layout, you should have good understanding about CSS float.
You can learn about CSS float from this link (Step By step CSS float tutorial[^] ) This is the best tutorial about CSS float that I even read.
|
|
|
|
|
I am adding rows at runtime in a gridview with a remove button in every row.
On clicking the remove button, the row having that remove button will be deleted.
Problem steps:-
1. I added 2 rows and then click a remove button of second row the second row will be deleted.
2. press f5 to refresh the page and it will give ERROR !!!
I think on clicking refresh it will fire the last event again but in this case, button that caused last event have been deleted
so button id will not found and error will be generated.
Can somebody tell me the solution !!!
Gaurav
|
|
|
|
|
G.K.M. wrote: ERROR
What ERROR?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi,
I have the directory named NDP on my local machine (named PC4) which is in a domain. On my domain server, I have IIS 6.0 (windows 2003) and database server.
I have the following sample code
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
Label1.Text = "";<br />
DataTable dt = new DataTable();<br />
<br />
<br />
StreamReader sr = new StreamReader(@"\\Pc4\C$\NDP\Test1.csv");<br />
<br />
string line;<br />
while((line = sr.ReadLine()) != null)<br />
{<br />
Label1.Text += line;<br />
<br />
<br />
}
I have impersonate="true" in web.config file. The authentication mode is WIndows Integrated authentication. I have given permissions to ASPNET accounts and Windows accounts for the NDP folder.
Can I read this .csv file? Because it is giving me error.
I have also this code.
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
String username = System.Security.Principal.WindowsIdentity.GetCurrent().Name;<br />
Label1.Text = username;<br />
<br />
<br />
}<br />
When executed it gives me the name of the user through which I have logged in but does not give access to my shared folder.
Totally stumped. Any Solutions???
|
|
|
|
|
It's not good idea to read the file from other machine in ASP.NET. What you should do is that you should create the web service that can copy the file from a particular machine (e.g. PC4 in your case) and upload those files to the service at specific time. then, read those files from your ASP.NET.
|
|
|
|
|
Dear Programmers,
I am developing a project in which there are two user levels. One is customer and another is administrator. I want to show customer one web1.sitemap and administrator anothere web2.sitemap. I have attached the menu on Master Page.
Please help me to solve this problem. reply me ASAP.
Thankyou.
|
|
|
|
|
You will want to configure two sitemap providers in your web.config file.
Reference the MSDN article[^] on the topic - that should help you.
Zeeshan Memon wrote: reply me ASAP.
Pretty demanding, aren't you?
|
|
|
|
|
hi
can some one guide me how to build a tag cloud specially its data fetching. i am using asp.net 1.1 with c# and sql server 2k.
details
i have problem in counting the tags.
i am storing the tags in a single column as varchar entry seprated by space, dont catch up with the idea how to get the distinct tags from single column and then got their weight as well
thanks in advance
shezi
|
|
|
|
|
|
i had seen it before. but that is a very simple case just count the products against a category, while i am storing tags in a single column seprated by space first need to get the indivisual tag and then its weight but got problem in making query.
need guidance regarding how to fetch tags and their weight from single column of a table
shezi
modified on Monday, January 21, 2008 2:36:47 AM
|
|
|
|
|
shah zad wrote: while i am storing tags in a single column seprated by space first need to get the indivisual tag and then its weight but got problem in making query
Well, if you normalise your data model you won't have that problem. You should only ever store a single piece of data in a column value. You should not be storing multiple tags in a single row.
You need to create a new table and split the tags out into the new table. Then set up a many-to-many join between your original table and your tags table. A many-to-many join requires the setting up of an intermediate table.
shah zad wrote: need guidance regarding how to fetch tags and their weight from single column of a table
While it is possible, it is increadibly inefficient and goes against decades of guidance on how to define relational databases.
|
|
|
|
|
Is it possible to enter data into a grid directly when a project is run.
|
|
|
|
|
SreejithAchutan wrote: Is it possible to enter data into a grid directly when a project is run.
Yes. But GridView does not support it directly. You have to manually make it editable. Use TemplateColumns and add controls and try.
|
|
|
|
|
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:ButtonField DataTextField="DeptName" CommandName="Select" HeaderText="DepartmentName" ></asp:ButtonField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txt1" runat="server"> </asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void Button1_Click(object sender, EventArgs e)
{
int DeptID;
string ID;
foreach (GridViewRow gr in GridView1.Rows)
{
ID = Gdv_Dept_List.SelectedDataKey.Value.ToString();
DeptID = int.Parse(ID);
TextBox tx = (TextBox)gr.FindControl("txt1");
insDept.up(DeptID,tx.Text);
BindGrid();
}
}
I gave the above design code and also in button click event above code is given.but when we tried to save it the selected field is updated to empty.what is the reason.
|
|
|
|
|
Are you trying to populate/defining value to the GridView on Page Load event?
|
|
|
|
|
Hi all,
I want to check whether a system is connected with a LAN or not? How can i do it using .Net either VB or C#.
Second thing is after detecting the network connection i want to find the IP address OR Machine name of the Local Area Network Server. And using that LAN server IP/Name i want to listout all the machines that are connected at this moment. How can i do this?
What way i can achieve the above needs? What are the namespaces should i require to achieve these things done?
Expecting ur reply. Please anyone help me?
regards
saravanan
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
saravanan05 wrote: I want to check whether a system is connected with a LAN or not? How can i do it using .Net either VB or C#.
I am not sure about checking the LAN connection.
saravanan05 wrote: Second thing is after detecting the network connection i want to find the IP address OR Machine name of the Local Area Network Server. And using that LAN server IP/Name i want to listout all the machines that are connected at this moment. How can i do this?
Try the below code. You get the computer's list in a DataTable.
public DataTable GetComputers
{
DataTable dtComputers = new DataTable("Computers");
DataColumn dc;
DataRow dr;
dc = new DataColumn("ComputerName");
dc.DataType = System.Type.GetType("System.String");
dc.MaxLength = 50;
dtComputers.Columns.Add(dc);
dc = new DataColumn("IPAddress");
dc.DataType = System.Type.GetType("System.String");
dc.MaxLength = 50;
dtComputers.Columns.Add(dc);
Process p = new Process();
p.StartInfo.FileName = @"net.exe";
p.StartInfo.Arguments = "VIEW";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.Start();
p.WaitForExit();
while (!p.StandardOutput.EndOfStream)
{
string readLine = p.StandardOutput.ReadLine();
string computerName = "";
if (readLine.IndexOf("\\") == 0)
{
dr = dtComputers.NewRow();
computerName = readLine.Substring(2, readLine.IndexOf(" ")).Trim();
Console.Write("\n" + computerName);
dr["ComputerName"] = computerName;
dr["IPAddress"] = Dns.GetHostEntry(computerName).AddressList[0];
dtComputers.Rows.Add(dr);
}
}
if (!p.HasExited) p.Kill();
return dtComputers;
}
|
|
|
|
|
hi friends
Am not getting EndOfStream after StandardOutput what namespace should be used for this.
what namespace should be used to get DNS.
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
Add,
using System.Diagnostics;
along with other namespace
|
|
|
|
|