Click here to Skip to main content
15,313,506 members

Comments by Member 10850253 (Top 90 by date)

Member 10850253 24-May-20 17:23pm View
   
From what I understand, I should be able to use the indexer, with the getter, since I am returning a list. I checked the link you gave me, but I still don't understand how to do this. I would really appreciate if you could give me an example on how to do this, in flutter.
Thanks for your help.
Member 10850253 24-May-20 12:34pm View
   
Can you please tell me, how can I do this?
I thought that with my getter, I would get the actual list, and that I would be able to use all the list properties.
Please help me find a solution.
Thanks.
Member 10850253 30-Oct-19 9:37am View
   
I was reading, and realized that this won't work, because It allows you to move files and I just want the user to view images in a folder organized image gallery.
Member 10850253 30-Oct-19 9:31am View
   
What I need is something like a file manager, but only for images, and I don't know if this will work.
Please let me know your thoughts.
Is there a tutorial on how to use this code?
Thanks.
Member 10850253 27-Oct-19 9:39am View
   
I tried that solution, but its still not working. I will leave my code as an answer.
Thanks for your help.
Member 10850253 29-Jan-19 16:10pm View
   
I found this alternative, but I don't know how to implement it.
https://stackoverflow.com/questions/25347946/add-fade-effect-in-slideshow-javascript[^]
Member 10850253 28-Jan-19 16:11pm View
   
I tried in IE, Edge, Firefox and Chrome and it didn't work in anyone of them.
Member 10850253 23-Jan-19 13:16pm View
   
I fixed the problem I ws having. I just have one more issue. The flash image gallery displays just fine in firefox, but it doesn't display in edge or chrome, any ideas why?
Thanks.
Member 10850253 23-Jan-19 11:50am View
   
I also tried using this code in xml, but still nothing:
.../thumbs/Logros-2016-2017/GL12_1.jpg
Please let me know how to load images from an xml file in a webhostapp website.
Thanks.
Member 10850253 23-Jan-19 10:19am View
   
I fixed the swf part, now the problem is that the images that should load from xml are not loading. I used /public_html/swfs/logros/test/images/Logros 2016-2017/GL10_1.jpg, as the path for one of the images, but I don't know what path should I use.
Can someone please help me out, and let me know which would be the full path, that I should use.
Thanks.
Member 10850253 23-Jan-19 9:16am View
   
I just tried the absolute path you gave me in the previous comment, but that didn't work. I know flash is a dead technology, but I have a nice image gallery, that I would like to use with my website. Please let me know if there is something else I can try.
Thanks.
Member 10850253 7-May-18 13:33pm View
   
I have no error, I just don't know how to convert my code from ontouch to entire image.
Member 10850253 18-Apr-18 11:52am View
   
I am trying to use paperdb, and I only added the compile statement in build gradle.
I think it has something to do with tha.
Please help me out.
Thanks.
Member 10850253 18-Apr-18 11:37am View
   
If you see the code I posted, I already tried that solution and still have the same error. Can you please help me with another solution? Thanks.
Member 10850253 10-Apr-18 14:22pm View
   
<pre>
//Error
04-10 12:13:10.619 4089-4089/com.hataflabs.batterywidget:remote E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.hataflabs.batterywidget:remote, PID: 4089
    android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=Battery Service pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x40 color=0x00000000 vis=PRIVATE)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1768)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Member 10850253 7-Apr-18 8:39am View
   
That is not the problem, the problem I have is that the service runs in a different process.
<service android:name="com.hataflabs.batterywidget.ConnectService"
            android:enabled="true"
            android:process=":remote" >
            <intent-filter>
                <action android:name="com.hataflabs.batterywidget.ConnectService" />
            </intent-filter>

        </service>
Member 10850253 29-Mar-18 16:20pm View
   
If I use the flash just to recognize the color, would that solve the light issue?
Member 10850253 25-Mar-18 16:49pm View
   
What I wanted to say was that I want to detect the true color in every light condition, but from what airline just read, this isn't possible.
Please correct me if I'm wrong.
Member 10850253 11-Mar-18 15:49pm View
   
I am using the camerabridgeviewbase class, instead of the javacameraview.
Member 10850253 11-Mar-18 14:20pm View
   
Yes. I am doing a live analysis on the the camera view, but I wish to turn on the led flash to have a better view of the image.
Can this be done, and if so, how? Thanks.
Member 10850253 31-Jan-18 9:05am View
   
This is the jQuery function that I am using.

$('#save').click(function () {
               
                var name_click = $('#name').text();
                var user_click = $('#user').text();
                var yr_click = $('#yr').text();
                var lbl_click = $('#lbl').text();
                var proy_id_click = $('#proy_id').val();
                var obj_click = $('#obj').prop('selectedIndex');
                var res_click = $('#res').prop('selectedIndex');
                var act2_click = $('#act2').prop('selectedIndex');
                var es_click = $('#es').prop('selectedIndex');
                var com_click = $('#com').val();
                var por_click = $('#por').val();
                console.log(proy_id_click + " , " + res_click + " ," + obj_click + ",  " + act2_click);               
                $.ajax({
                    url: 'Formulario.aspx/salvar',
                    type: "POST",
                    data: '{name_click:' + name_click + 'yr_click:' + yr_click + 'user_click:' + user_click + 'lbl_click:' + lbl_click + 'proy_id_click:' + proy_id_click + 'obj_click:' + obj_click + 'res_click:' + res_click + 'act2_click:' + act2_click + 'es_click:' + es_click + 'com_click:' + com_click + 'por_click:' + por_click + '}',
                    success: function (jsonData) {
                        console.log(jsonData);
                        $("#candg ").prop('selectedIndex', 0);
                        $("#es").prop('selectedIndex', 0);
                        $("#act2 ").prop('selectedIndex', 0);
                        $("#obj ").prop('selectedIndex', 0);
                        $("#res ").prop('selectedIndex', 0);
                        $("#lbl").html("");
                        $("#com").val("");
                        $("#por").val("");
                        alert("Successfully done");
                    }
                })//;?
            });
Member 10850253 30-Jan-18 20:56pm View
   
I am using jQuery to set the onclick event, since the postback messes my website.
I am sending the text from my gui elements with jQuery.
Please let me know how I can solve my problem.
I will post my jquery code later.
Thanks.
Member 10850253 30-Jan-18 15:29pm View
   
Thanks for the replay.
I am not getting any errors.
I did some validation for the data that can be inserted on the fields, so the injection doesn't get me worried.
I don't know what is wrong.
Please help me.
Thanks.
Member 10850253 27-Jan-18 10:12am View
   
I think I found one problem, but I am still having the same issue.
The problem is that in the selectedindex change event, I was using the index of that field.
What I did is instead of calling the selected index changed event, I used a button, but even so, after selection in that dropdown, the values in it reset.
Member 10850253 26-Dec-17 15:29pm View
   
I just solved the issue.
I will post the solution later.
Member 10850253 20-Dec-17 7:48am View
   
I checked and the initial and closing tags are in the edit class, and the rest are in the first line of code. Do you have any other ideas to help me fix this. Thanks.
Member 10850253 19-Dec-17 16:26pm View
   
I just removed some characters from my statement, such as ', delete and drop.
That's the best I could do, because I tried the parameters and it gave me an error.
Member 10850253 19-Dec-17 14:52pm View
   
I can't find that statement.
I can only find Mysql.Data...
Member 10850253 19-Dec-17 13:16pm View
   
I found this: https://www.youtube.com/watch?v=5m6dCbYO0Mk, but the thing is that I am using MYSQL instead of SQL and the SqlParameter doesn't work.
Can you please help?
Thanks.
Member 10850253 15-Dec-17 12:39pm View
   
Can I rerun the log file from visual studio, with arcgis installed? Do I need to install the sdk or just a nuget package?
Member 10850253 14-Dec-17 16:39pm View
   
I read that I can use dlls in visual studio to import functions from other software, but I don't know if I can import the dlls from ARCGIS, and write to file, after I execute a function from an ARC dll.
please let me know your thoughts.
Member 10850253 14-Dec-17 11:23am View
   
There is the arcgis.runtime package in nuget, but I don't know if I can develop a standalone app, that uses arcgis function, without the need of installing arcgis, and use the view execution tool in arcgis, to run the log file in this app.
Thanks for your help.
Member 10850253 13-Dec-17 16:32pm View
   
It's a history of all the geoprocesses that have been made in the arcgis project.
Member 10850253 10-Dec-17 18:11pm View
   
I did as you suggested, but nothing happens.
<pre>private void timer1_Tick(object sender, EventArgs e)
        {
            Close();
        }
Member 10850253 10-Dec-17 17:49pm View
   
I used this, and nothing happens:
using (BetterDialog dialog = new BetterDialog(title, largeHeading, smallExplanation, leftButton,rightButton, iconSet))
            {
                DialogResult result = dialog.ShowDialog();
                Thread.Sleep(1000);
                dialog.Close();
                return result;                               
            }
Member 10850253 10-Dec-17 17:29pm View
   
But How?
Here is my dialog class code:
public partial class BetterDialog : Form
    {
        /// <summary>
        /// Create a special dialog in the style of Windows XP or Vista. A dialog has a custom icon, an optional large
        /// title in the form, body text, window text, and one or two custom-labeled buttons.
        /// </summary>
        /// <param name="titleString">This string will be displayed in the system window frame.</param>
        /// <param name="bigString">This is the first string to appear in the dialog. It will be most prominent.</param>
        /// <param name="smallString">This string appears either under the big string, or is null, which means it is
        /// not displayed at all.</param>
        /// <param name="leftButton">This is the left button, typically the "accept" button--label it with an
        /// action verb (or "OK").</param>
        /// <param name="rightButton">The right button--typically "Cancel", but could be "No".</param>
        /// <param name="iconSet">An image to be displayed on the left side of the dialog. Should be 32 x 32 pixels.</param>
        static public DialogResult ShowDialog(string title, string largeHeading, string smallExplanation,string leftButton, string rightButton, Image iconSet)
        {
            //title, largeHeading,smallExplanation, leftButton, rightButton, iconSet
            using (BetterDialog dialog = new BetterDialog(title, largeHeading, smallExplanation, leftButton,rightButton, iconSet))
            {
                DialogResult result = dialog.ShowDialog();                
                return result;                               
            }
        }

        /// <summary>
        /// The private constructor. This is only called by the static method ShowDialog.
        /// </summary>
        private BetterDialog(string title, string largeHeading, string smallExplanation,string leftButton, string rightButton, Image iconSet)
        {
            this.Font = SystemFonts.MessageBoxFont;
            this.ForeColor = SystemColors.WindowText;

            InitializeComponent();

            // set our width and height to these values (redundant, but who cares?)
            this.Width = 350;
            this.Height = 150;

            using (Graphics graphics = this.CreateGraphics())
            {
                SizeF smallSize;
                SizeF bigSize;

                if (string.IsNullOrEmpty(smallExplanation) == false)
                {
                    if (SystemFonts.MessageBoxFont.FontFamily.Name == "Segoe UI")
                    {
                        // use the special, windows-vista font style if we are running vista (using Segoe UI).
                        label1.ForeColor = Color.FromArgb(0, 51, 153); // [ColorTranslator.FromHtml("#003399")]
                        label1.Font = new Font("Segoe UI", 12.0f, FontStyle.Regular, GraphicsUnit.Point);

                        // bigger for vista/aero
                        this.Width += 50;

                        label1.Width += 50;
                        label2.Width += 50;

                        smallSize = graphics.MeasureString(smallExplanation, this.Font, this.label2.Width);
                        bigSize = graphics.MeasureString(largeHeading, label1.Font, this.label1.Width);

                        this.Height = (int)smallSize.Height + 158;

                        // add in a little margin on the top as well
                        pictureBox1.Margin = new Padding(pictureBox1.Margin.Left, pictureBox1.Margin.Top + 6,
                            pictureBox1.Margin.Right, pictureBox1.Margin.Bottom);
                    }
                    else
                    {
                        // might want to special case the old, MS Sans Serif font.
                        // use the regular
Member 10850253 7-Dec-17 15:03pm View
   
you were right, I was looking at another piece of code. I worked, thanks.
Member 10850253 7-Dec-17 14:54pm View
   
I think the problem may be that proy1 is the same in poth cases, but the thing that changes is year2. I tried all these suggestions and all the table gets deleted. Please let me know how I can fix this.
Thanks.
Member 10850253 7-Dec-17 14:45pm View
   
Yes. I have different years and the same project, but all the table gets deleted.
Member 10850253 7-Dec-17 14:35pm View
   
Exactly that, but without the joker character.
Member 10850253 7-Dec-17 14:35pm View
   
Exactly that, but without the joker character.
Member 10850253 7-Dec-17 14:32pm View
   
I tried that already and had the same result.
Please help me find another solution.
Thanks.
Member 10850253 7-Dec-17 14:12pm View
   
I also tried that, and it didn't work. If you have any other suggestions, please let me know.
Thanks.
Member 10850253 21-Nov-17 17:43pm View
   
Thanks.
Now the text isn't clearing, but I still can't graph on index change.
Can you please help me?
Member 10850253 21-Nov-17 17:11pm View
   
graph
Member 10850253 18-Nov-17 13:10pm View
   
Please let me know how should I display a sheet in gridview, based on a combobox selection.
Member 10850253 18-Nov-17 9:03am View
   
I loaded all the worksheets in a combobox, but now I want to load the excel file to a gridview, depending on the selection of the combobox.
using System;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Configuration; 

public partial class _Default : System.Web.UI.Page 
{
    public static OleDbConnection connExcel;
    public static OleDbCommand cmdExcel;
    public static OleDbDataAdapter oda;
    public static DataTable dt;
    public static string FilePath;
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile)
        {
            string FileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
            string Extension = Path.GetExtension(FileUpload1.PostedFile.FileName);
            string FolderPath = ConfigurationManager.AppSettings["FolderPath"];

            FilePath = Server.MapPath(FolderPath + FileName);
            FileUpload1.SaveAs(FilePath);
            Import_To_Grid(FilePath, Extension, rbHDR.SelectedItem.Text);
        }
    }
    private void Import_To_Grid(string FilePath, string Extension, string isHDR)
    {
        string conStr="";
        switch (Extension)
        {
            case ".xls": //Excel 97-03
                conStr = ConfigurationManager.ConnectionStrings["Excel03ConString"].ConnectionString;
                break;
            case ".xlsx": //Excel 07
                conStr = ConfigurationManager.ConnectionStrings["Excel07ConString"].ConnectionString;
                break;
        }
        conStr = String.Format(conStr, FilePath, isHDR);
        connExcel = new OleDbConnection(conStr);
        cmdExcel = new OleDbCommand();
        oda = new OleDbDataAdapter();
        dt = new DataTable(); 
        cmdExcel.Connection = connExcel;

        //Get the name of First Sheet
        connExcel.Open();
        DataTable dtExcelSchema;
        dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
        for (int i = 0; i < dtExcelSchema.Rows.Count; i++)

        {

            String sheetName = dtExcelSchema.Rows[i]["TABLE_NAME"].ToString();

            sheetName = sheetName.Substring(0, sheetName.Length - 1);

            sheet.Items.Add(sheetName);

        }
        //string SheetName = dtExcelSchema.Rows[0]["TABLE_NAME"].ToString();
        connExcel.Close();

       
    }
    protected void PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        string FolderPath = ConfigurationManager.AppSettings["FolderPath"] ;
        string FileName = GridView1.Caption;
        string Extension = Path.GetExtension(FileName);
        string FilePath = Server.MapPath(FolderPath + FileName);

        Import_To_Grid(FilePath, Extension, rbHDR.SelectedItem.Text);  
        GridView1.PageIndex = e.NewPageIndex;
        GridView1.DataBind();  
    }

    protected void sheet_SelectedIndexChanged(object sender, EventArgs e)
    {
        //Read Data from First Sheet
        connExcel.Open();
        cmdExcel.CommandText = "SELECT * From [" + sheet.Text.ToString() + "]";
        oda.SelectCommand = cmdExcel;
        oda.Fill(dt);
        connExcel.Close();

        //Bind Data to GridView
        GridView1.Caption = Path.GetFileName(FilePath);
        GridView1.DataSource = dt;
        GridView1.DataBind();
    }
}
Member 10850253 18-Nov-17 9:03am View
   
I loaded all the worksheets in a combobox, but now I want to load the excel file to a gridview, depending on the selection of the combobox.
using System;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Configuration; 

public partial class _Default : System.Web.UI.Page 
{
    public static OleDbConnection connExcel;
    public static OleDbCommand cmdExcel;
    public static OleDbDataAdapter oda;
    public static DataTable dt;
    public static string FilePath;
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile)
        {
            string FileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
            string Extension = Path.GetExtension(FileUpload1.PostedFile.FileName);
            string FolderPath = ConfigurationManager.AppSettings["FolderPath"];

            FilePath = Server.MapPath(FolderPath + FileName);
            FileUpload1.SaveAs(FilePath);
            Import_To_Grid(FilePath, Extension, rbHDR.SelectedItem.Text);
        }
    }
    private void Import_To_Grid(string FilePath, string Extension, string isHDR)
    {
        string conStr="";
        switch (Extension)
        {
            case ".xls": //Excel 97-03
                conStr = ConfigurationManager.ConnectionStrings["Excel03ConString"].ConnectionString;
                break;
            case ".xlsx": //Excel 07
                conStr = ConfigurationManager.ConnectionStrings["Excel07ConString"].ConnectionString;
                break;
        }
        conStr = String.Format(conStr, FilePath, isHDR);
        connExcel = new OleDbConnection(conStr);
        cmdExcel = new OleDbCommand();
        oda = new OleDbDataAdapter();
        dt = new DataTable(); 
        cmdExcel.Connection = connExcel;

        //Get the name of First Sheet
        connExcel.Open();
        DataTable dtExcelSchema;
        dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
        for (int i = 0; i < dtExcelSchema.Rows.Count; i++)

        {

            String sheetName = dtExcelSchema.Rows[i]["TABLE_NAME"].ToString();

            sheetName = sheetName.Substring(0, sheetName.Length - 1);

            sheet.Items.Add(sheetName);

        }
        //string SheetName = dtExcelSchema.Rows[0]["TABLE_NAME"].ToString();
        connExcel.Close();

       
    }
    protected void PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        string FolderPath = ConfigurationManager.AppSettings["FolderPath"] ;
        string FileName = GridView1.Caption;
        string Extension = Path.GetExtension(FileName);
        string FilePath = Server.MapPath(FolderPath + FileName);

        Import_To_Grid(FilePath, Extension, rbHDR.SelectedItem.Text);  
        GridView1.PageIndex = e.NewPageIndex;
        GridView1.DataBind();  
    }

    protected void sheet_SelectedIndexChanged(object sender, EventArgs e)
    {
        //Read Data from First Sheet
        connExcel.Open();
        cmdExcel.CommandText = "SELECT * From [" + sheet.Text.ToString() + "]";
        oda.SelectCommand = cmdExcel;
        oda.Fill(dt);
        connExcel.Close();

        //Bind Data to GridView
        GridView1.Caption = Path.GetFileName(FilePath);
        GridView1.DataSource = dt;
        GridView1.DataBind();
    }
}
Member 10850253 18-Nov-17 8:24am View
   
How to load any sheet of an excel workbook in asp.net c#?
Member 10850253 17-Nov-17 21:43pm View
   
I have a question.
I use the
MapPath(FileUpload1.PostedFile.FileName)

but this gives me the path of the project with the name of the file, and not the path of the actual file that I am uploading.
How can I fix this?
Thanks.
Member 10850253 19-May-17 13:55pm View
   
I made a file explorer in c#, with many commands, but now I want to be able to use that code and convert it to html, so I can use it as a web based app.
Member 10850253 18-May-17 18:16pm View
   
This is the project, so that someone can help me fix the issue:
http://www.mediafire.com/file/h5cv956htw48a9x/FileSystemTreeView+-+Multimedia+7.0+-+Background+V3.zip
Member 10850253 20-Apr-17 15:47pm View
   
How would I add admin privileges to my app programatically on app start?
Member 10850253 16-Feb-17 11:07am View
   
it opens my computer.
Can there be a problem with my vs2010, cause I was receiving an error when I opened it, saying that there might be a problem with an addon.
Member 10850253 16-Feb-17 10:55am View
   
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;

namespace Galeria_de_Imagenes
{
public partial class Form1 : Form
{
public static String exactpath = @"";
string substringDirectory;
public Form1()
{
InitializeComponent();
list.Nodes.Clear();
ListDirectory();
}
private void ListDirectory()
{
list.Nodes.Clear();
var rootDirectoryInfo = new DirectoryInfo(Path.GetFullPath(Directory.GetCurrentDirectory()));
list.Nodes.Add(CreateDirectoryNode(rootDirectoryInfo));
}
private static TreeNode CreateDirectoryNode(DirectoryInfo directoryInfo)
{
var directoryNode = new TreeNode(directoryInfo.Name);
foreach (var directory in directoryInfo.GetDirectories())
directoryNode.Nodes.Add(CreateDirectoryNode(directory));
foreach (var file in directoryInfo.GetFiles())
directoryNode.Nodes.Add(new TreeNode(file.Name));
return directoryNode;
}
private void FillOneLevel(TreeNode root, string path)
{
DirectoryInfo di = new DirectoryInfo(path);

try
{

foreach (DirectoryInfo subFolder in di.GetDirectories())
{
TreeNode node = new TreeNode(subFolder.Name);
node.Tag = subFolder.FullName;
root.Nodes.Add(node);
}
}
catch (Exception ex)
{
}
}

private void list_AfterSelect(object sender, TreeViewEventArgs e)
{
TreeNode CurrentNode= e.Node;
exactpath = @Path.GetFullPath(CurrentNode.FullPath);
}

private void pathbtn_Click(object sender, EventArgs e)
{
MessageBox.Show(exactpath);
System.Diagnostics.Process.Start("explorer.exe", string.Format("/select, \"{0}\"", exactpath));
}
}
}
Member 10850253 16-Feb-17 10:54am View
   
I will share my whole code as a solution, so you can take alook at it.
Member 10850253 16-Feb-17 10:45am View
   
I used MessageBox.show(exactpath);
and it gives me that same value.
Member 10850253 16-Feb-17 10:36am View
   
this is the directory I am using now:
D:\Works\Fernando\CRS\ASA - CRS\ASA\Años de Trabajo\2017\Archives\C#\Galeria de Imagenes\Galeria de Imagenes\bin\Debug\Fotos\prueba
I got this directly from navigating to the folder on the explorer.
Member 10850253 16-Feb-17 10:28am View
   
Still not working. It takes some place in my documents, and I have the project in drive D.
I am using:

string exactpath = @Path.GetFullPath(folder2);
//folder2 is a relative path
System.Diagnostics.Process.Start("explorer.exe", string.Format("/select, \"{0}\"", exactpath));
Member 10850253 5-Feb-17 9:54am View
   
I could exit the app if there is another instance of the app running, but how can I check if there is another instance running?
Member 10850253 10-Jan-17 9:17am View
   
I will post the code, so as an answer, so I can use tags.
Member 10850253 7-Jan-17 15:14pm View
   
What I don't want to happen is for the app to open 2 instances of the app, if I double click the app's shortcut twice.
Member 10850253 7-Jan-17 13:58pm View
   
I don't know where to place that code inside my form, to prevent it from creating 2 instances. I know there should be something like new form() somewhere, but I don't know.
Member 10850253 7-Jan-17 11:05am View
   
I added a solution so you can view the code, can you please help?
Member 10850253 7-Jan-17 9:56am View
   
one form in an application
Member 10850253 7-Jan-17 9:53am View
   
yes
Member 10850253 7-Jan-17 9:37am View
   
I tried comparing the Application.OpenForms.Count==0, and if that was true, then I ran the application, but that doesn't work, and I was wondering if you could tell me where do I need to use this property?
Member 10850253 16-Sep-16 14:19pm View
   
Is there a way to check if the subdirectories in the source folder exist in the destination folder, so that the files from the source replace the ones in the destination, in the folders that already exist?
Member 10850253 22-Sep-15 11:41am View
   
Now I am using these lines of code to get the actual path of the file:

string path2 = Path.GetFullPath(Path.GetFileName(list.SelectedNode.Text));
var lastFolder = Path.GetDirectoryName(path2);
var pathWithoutLastFolder = Path.GetDirectoryName(lastFolder);
string path3 = pathWithoutLastFolder +"\\"+ ((TreeView)sender).SelectedNode.FullPath;

But it adds double\ to all the folder separators in the path.
How can I fix this?
Thanks.
Member 10850253 22-Sep-15 10:15am View
   
I found out why I get the error, but the thin is that I don't know how to fix it. I get that error, because the app is looking for the files in the applications working directory and not inside the folders in which the files are located. I use Applicate.StartupPath to set the working directory, but I thought that by doing Path.GetFullPath(Path.GetFileName(list.selectedNode.text));
That would give me the path where the files are located, but it doesn't do that.
Can someone please help me out?
Thanks.
Member 10850253 21-Sep-15 22:26pm View
   
I think the only solution would be to change the current directory to the directory where the files are located.
I am using:

Directory.SetCurrentDirectory(Path.GetDirectoryName(Path.GetFullPath(Path.GetFileName(list.SelectedNode.Text))));

But it doesn't change anything.
Can someone please help?
Thanks in advance.
Member 10850253 21-Sep-15 21:47pm View
   
I am using this line of code to get the directory where my files are located:

DirectoryInfo dir = new DirectoryInfo(Path.GetFullPath(Path.GetFileName(list.SelectedNode.Text)));

But it seems the compiler can't find the files. I found this link that explains why, but don't know how to fix it:
http://stackoverflow.com/questions/11770928/c-sharp-cant-find-file
Member 10850253 21-Sep-15 17:39pm View
   
The problem is that the directory doesn't exist, or at least that is what the debugger says, because I have the files there.
Member 10850253 21-Sep-15 17:25pm View
   
Sorry about that, I just figured it out. The error I get is that dir = null, and media = null
Member 10850253 21-Sep-15 16:37pm View
   
How can I use it in visual studio
Member 10850253 21-Sep-15 16:36pm View
   
No
Member 10850253 21-Sep-15 16:36pm View
   
The strange thing is that if I place the files in the same directory as the app, it works dine. The problem begins when I place the files inside folders.
Member 10850253 21-Sep-15 16:34pm View
   
It is located in the same directory as the app "D: ....", and the name of the app contains a number and spaces
Member 10850253 21-Sep-15 16:31pm View
   
Instead of using Directory.GetCurrentDirectory(), I used Application.startuppath
Member 10850253 21-Sep-15 16:29pm View
   
Sorry about that
Member 10850253 21-Sep-15 16:27pm View
   
A video file
Member 10850253 21-Sep-15 14:53pm View
   
I changed the code where I use a relative path to:

var rootDirectoryInfo = new DirectoryInfo(Path.GetFullPath(Directory.GetCurrentDirectory()));

But I still get the error path not found in this line:

DirectoryInfo dir = new DirectoryInfo(Path.GetFullPath(Path.GetFileName(list.SelectedNode.Text)));
//Could not find part of the path in a foreach statement I use to get all the files using dir.GetFiles()
How can I fix this?
Thanks!
Member 10850253 21-Sep-15 14:18pm View
   
I changed it to this:

DirectoryInfo dir = new DirectoryInfo(Path.GetFullPath(Path.GetFileName(list.SelectedNode.Text)));

But I am still getting the error.
How can I fix this?
Thanks!
Member 10850253 21-Sep-15 14:16pm View
   
Deleted
I changed it to this:
<pre>
private void ListDirectory()
{
list.Nodes.Clear();
var rootDirectoryInfo = new DirectoryInfo(Path.GetFullPath(Directory.GetCurrentDirectory()));
path.Text = rootDirectoryInfo.ToString();
list.Nodes.Add(CreateDirectoryNode(rootDirectoryInfo));
}

private static TreeNode CreateDirectoryNode(DirectoryInfo directoryInfo)
{
var directoryNode = new TreeNode(directoryInfo.Name);
foreach (var directory in directoryInfo.GetDirectories())
directoryNode.Nodes.Add(CreateDirectoryNode(directory));
foreach (var file in directoryInfo.GetFiles())
directoryNode.Nodes.Add(new TreeNode(file.Name));
return directoryNode;
}
private void list_AfterSelect(object sender, TreeViewEventArgs e)
{
WMPLib.IWMPPlaylist playlist = player.playlistCollection.newPlaylist("media_playlist");
WMPLib.IWMPMedia media;
//player.close()
DirectoryInfo dir = new DirectoryInfo(Path.GetFullPath(Path.GetFileName(list.SelectedNode.Text)));
if (list.SelectedNode.FullPath.Length!=0)
{
//I am getting the error in this next line
foreach (var file in dir.GetFiles())
{
media = player.newMedia(Path.GetFullPath(Path.GetFileName(file.ToString())));
playlist.appendItem(media);
path.Text=Path.GetFullPath(Path.GetFileName(file.ToString()));
}
list.Visible = false;
player.currentPlaylist = playlist;
player.Ctlcontrols.play();
}else{
MessageBox.Show("Directory not found!");
}
}
</pre>

How can I fix this?
Thanks!
Member 10850253 20-Sep-15 12:33pm View
   
I already can change to the next node, but what I can't do is make wmp play the next file in the next node.
Can you please help me?
Member 10850253 23-Apr-15 7:37am View
   
Is it possible to send a signal to my java app, when a system shutdown, restart, logoff, sleep or hibernate occurs from an app made in c/c++?
Member 10850253 23-Apr-15 7:00am View
   
If I do this in c/c++, can I include that code in my java project, as an external library or something like that?
Member 10850253 21-Apr-15 6:36am View
   
It just wont connect while in netbeans it does connect to my arduino.
Member 10850253 21-Apr-15 6:35am View
   
I added this jar in the tools menu, and then libraries, for it to work. Can I add a library from the tools menu in the build options of my project in netbeans?
Member 10850253 20-Apr-15 10:57am View
   
I found what was the problem and it is not the root access. The problem is that it is not including the external libraries when I build the jar file. I found this:
http://www.coderanch.com/t/419419/vc/netbeans-include-external-libraries-project
and it says there, that I can add some code to the bottom of the build.xml, but it still does not work. I added the library by going to tools and I also added a javadoc, because it is required and then added that in the app properties, I don't know if that makes a difference. Thanks.