|
I tried this now but it still gets me "SYSTEM" instead of my current name i logged on with Don't have any problems with getting computer name etc.. Just need to get my current logonname in Windows in stead of "SYSTEM".. *sigh* ;(
|
|
|
|
|
hi, i am facing this trouble (pretty obvious tho')
im working with a xmldocument, the trick is this is coming with some empty attributes
i want to browse for the empty attributes and to get rid of them
this is the example of what do i receive
and under is what ive tried
it does only displays the name of the empty attribute
but do not know how to erase that from the node
SO MANY THANKS IN ADVANCE, PEOPLE !!!
===========================================================
NOW IS LIKE :
example attrib1="" attrib2="yes" attrib3="no" attrib4=""
node attribX=""
-----------------------------------------------------------
SHOULD BE LIKE :
example attrib2="yes" attrib3="no"
node
===========================================================
<br />
XmlDocument xmlDoc = new XmlDocument(); <br />
xmlDoc.Load("nuevo.xml");<br />
XmlNodeList nodes = xmlDoc.SelectNodes("//@*"); <br />
foreach(XmlNode node in nodes) <br />
{ <br />
if (node.Value.ToString() == "")<br />
{<br />
Console.WriteLine(node.Name.ToString());<br />
}<br />
}<br />
Console.ReadLine();<br />
-- modified at 13:21 Saturday 12th November, 2005
|
|
|
|
|
|
ok my problem is..
when i enter this code inside the load event it returns the name of the form opened before this form..
private void editForm_Load(object sender, System.EventArgs e)
{
MessageBox.Show(ActiveForm.Name.ToString());
}
which returns AdminPanel ( which is the previous form ) but what i want is to see editForm ( which is the form i'm currently opening )
i know its because the form is loading and thats why the currently activeform is AdminPanel but i need to see editForm because:
i have a listbox which gets data from mssql and puts the data to listbox, and someforms of i use are inherited from editForm so while this editForm is loading i want to fetch the data from the unique table so i can see the datas in the listbox after the form is loaded
so my code should be something like this..
private void editForm_Load(object sender, System.EventArgs e)
{
Classes.editClass eC = new HalkDanisv03.Classes.editClass(); // create new object
if(ActiveForm.Name.ToString() == "editEmployee")
{
eC.getStaffUsername(xList,"employeeinfo"); // employeeinfo is the name of the tablename
}
else if(ActiveForm.Name.ToString() == "editManager")
{
eC.getStaffUsername(xList,"managerinfo"); //managerinfo is the name of the tablename
}
}
any help would be great..
thx guys..
good coding
|
|
|
|
|
Would this.Name not work?
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
it works thx so much
|
|
|
|
|
FYI, your form isn't "active" until AFTER the Load event completes.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hye,
for personnal need i started a free Imap library, you'll find it at http://xemail-net.sourceforge.net/ .
This library is functionnal under Linux platform (Mono ) beacause I use Mono.Security to manage Certificats in Ssl connection. So If you use Windows please Help me to port this library to Windows.
Thx
eskan.
|
|
|
|
|
Hi
In VB 6 I used to export crystal report to almost any type
This sample “export report to txt file”
Dim myExportFile As String
myExportFile = App.Path + "\temp.xls"
Report.ExportOptions.DiskFileName = myExportFile
Report.ExportOptions.FormatType = crEFTText
Report.ExportOptions.DestinationType = crEDTDiskFile
Report.ExportOptions.RTFExportAllPages = True
Report.Export (False)
But in Visual Studio 2003 I can't Export to plain txt file
Check out this code,
// Set the Export type, this can be:
// PDF, Excel, Word Doc, RTF Doc,
// HTML 3.2, HTML 4.0 or CrystalReport no txt file
// The path/location where the exported file will be saved
string exportFilePath = MY_PATH+"\\RPTFOH\\Report1.DOC";
// Create an instance of the untyped report object
ReportDocument oRpt = new ReportDocument();
// Load the report from disk
oRpt.Load(@"C:\Test\RPTFOH\Report_1.rpt");
// Set the options for saving the exported file to disk
DiskFileDestinationOptions oDest = new DiskFileDestinationOptions();
oDest.DiskFileName = exportFilePath;
// Set the exporting information
ExportOptions oExport = oRpt.ExportOptions;
// Set the destination options
oExport.DestinationOptions = oDest;
// Set the location, this can be:
// DiskFile, ExchangeFolder, MicrosoftMail or NoDestination
oExport.ExportDestinationType = ExportDestinationType.DiskFile;
// Set the Export type, this can be:
// PDF, Excel, Word Doc, RTF Doc,
// HTML 3.2, HTML 4.0 or CrystalReport
oExport.ExportFormatType = ExportFormatType.WordForWindows;
// Call the Export method to export the report
oRpt.Export();
Please it's urgent,
I need to export Report to txt file.
Thanks in advance.
|
|
|
|
|
Hi!
Because one of the export formats is RTF you could use this to create an rtf file. This file can be read by a RichTextBox and saved as plain text.
Hope this helps,
mav
|
|
|
|
|
Dear Sir and Madam,
In asp.net How to allow user go to a page
when user enter url pattern like the example below?
http://PageToGo.Lantip.com
Thank You.
|
|
|
|
|
Assuming you're not talking about a static hyperlink on a page, but some user-editable URL, and you're okay with a PostBack, then you could do something like:
Response.Redirect(userUrl);
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Can anyone help. Is it possible to obtain the filename of a program that starts your application? i.e. I have written a front end program for AutoCAD and have associated my app with the AutoCAD .dwg file extension. What I want to do is let the user click any drawing file, which will launch my app instead of AutoCAD, let them select options from my app then click a 'go' button to continue to load the drawing. How do I get the file name of the dwg that they clicked in the first place though? I have tried Application.ExecutablePath but this just returns the file name of my app, this is the only thing that prevents my app from working and I can't find an answer on MSDN. It must be possible because apps like word, excel and AutoCAD display the filename that started the app. Please help!!!!!!!!
|
|
|
|
|
You must first disassociate AutoCAD and associate your application with that extension. The recommended way is to use the Win32 API to do that, alternatively, you can do it by manipulating the registry.
The registry setting will be
HKEY_CLASSES_ROOT
.dwg
Default AutoCADXYZ
AutoCADXYZ
shell
open
command
"<AutoCAD Path>" "%1"
Put your application path instead of AutoCAD Path and you should be done.
As you can see, the filename will come in as a command line argument to your application.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks, how do I assign that command line filename to a variable in my application then, so that I can launch AutoCAD with that filename?
|
|
|
|
|
You get command line arguments as parameters to Main, so you can simply assign them to variables there.
static void Main(string []args)
{
string fileName = args[0];
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
superb, thanks for your help
|
|
|
|
|
ok my problem is like this..
i want to make a method for clearing textbox`s in a form and the method looks like this..
public void clearTextBox(TextBox a, TextBox b)
{
a.Text="";
b.Text="";
}
of course it will clear only two textbox`s which i decleared..
but i want my method to clear n textbox so i can use this method several times..
how should the code look like ?
i remember from c++ it should be something like this but its not working at c#:
public void clearTextBox(TextBox a,...,Textbox b);
any help would be great..
thanx guys..
good coding..
|
|
|
|
|
void ClearText(params Textbox[] text)
{
foreach (Textbox t in text)
t.Text = "";
}
Then, you can call it with any number of arguments:
ClearText(TextBox1, TextBox2, TextBox3);
I don't see dead pixels anymore...
Yes, even I am blogging now!
-- modified at 6:59 Saturday 12th November, 2005
|
|
|
|
|
Hi my friend.
I want to make beep or warning alert in my form , but , I can't do it.
I just can make it with windows media player.
Thank you for your help.
|
|
|
|
|
u need to use the windows api MessageBeep
try this[^]
hope that help
g00fy
|
|
|
|
|
The SoundControl available in .NET 2.0 .
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
Is it possible to change (or rather set) an environmental variable at install time with the installer from VS2003 or VS2005.
I am using the Oracle Instant client and need to add the "nls_lang=America.American......" environment string.
Likewise can registry settings be set.
Thanks
|
|
|
|
|
Think I have done it - a test will tell
Right Click on the Deployment Project
Select View
Select Registry
On [HKEY_LOCAL_MACHINE] add key "SYSTEM"
On [System] add key "CurrentControlSet"
On [CurrentControlSet] add key "Control"
On [Control] add key "Session Manager"
On [Session Manager] add key "Environment"
On [Environment] add keystring Variable Name and in it's properties add the value
Hope this helps someone else
|
|
|
|
|
how to download a file from a remote server using FTP through ASP.NET/C#
-- modified at 1:42 Saturday 12th November, 2005
|
|
|
|